git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: fatal: Unable to mark file .ruby-version

From
Arup Rakshit <aruprakshit@rocketmail.com>
Date
Mar 16, 2015, 05:29 UTC
Message-ID
<186241547.130512.1426483752551.JavaMail.yahoo@mail.yahoo.com>
In-Reply-To
<20150315174543.GA11832@vps892.directvps.nl>

On Sunday, 15 March 2015 11:15 PM, Kevin D <me@ikke.info> wrote: On Sun, Mar 15, 2015 at 05:58:19PM +0100, t.gummerer@gmail.com wrote:

Show 15 quoted lines
> On 03/15, Arup Rakshit wrote:
> > On Sunday, March 15, 2015 01:30:04 PM you wrote:
> > > 
> > > With --assume-unchanged you're promising git that you will not change
> > > a file that is already in the repository.  Git doesn't check those
> > > files for changes anymore, which can improve performance.
> > > 
> > 
> > I didn't understand your point. Could you please elaborate more on it ?
> 
> --assume-unchanged only works on files that you added on the
> repository, not on untracked files.  Because you don't seem to want
> these files in the repository, update-index --assume-unchanged will
> not work for you.
> 

And to elaborate what on what t.gummerer meant earlier: git update-index --assume-unchanged is often abused to ignore already tracked files, thinking that they can change the file while git happily ignores it.

--assume-unchanged was neaver built for this purpose, it's built for large code bases where parts of the code base never changes, and git checking this part would only slow it down. So that's why it's called a promise to git that the file never changes, because git doesn't check the status of the file everytime you run git status.

But because the file is still tracked, any commit that changes the file causes git to still update that file, but git will then protest, because it found it the file actually changed in the mean time, and you broke that promise.

But also already said, this only applies to tracked files, so not to files that aren't being tracked in the first place.

Kevin

Thanks both of you. As per your suggestions I resolved it. I found a good link on this topic too https://help.github.com/articles/ignoring-files/.

Regards, Arup Rakshit

Previous: Kevin D
Message 6 of 6 in “fatal: Unable to mark file .ruby-version”
  1. Arup RakshitMar 15, 2015
  2. t.gummerer@gmail.comMar 15, 2015
  3. Arup RakshitMar 15, 2015
  4. t.gummerer@gmail.comMar 15, 2015
  5. Kevin DMar 15, 2015
  6. Arup RakshitMar 16, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.