# fatal: Unable to mark file .ruby-version

6 messages from 2015-03-15 to 2015-03-16. Participants: Arup Rakshit, t.gummerer@gmail.com, Kevin D.
Thread: https://gitlist.dev/t/38811

## Arup Rakshit, 2015-03-15 10:01

Subject: fatal: Unable to mark file .ruby-version
Message-ID: <1645103.91WotSCBpm@linux-wzza.site>
URL: https://gitlist.dev/e/1645103.91WotSCBpm%40linux-wzza.site

```
Hi,

I am trying to ignore 2 files, but getting error -

[arup@sztukajedzenia (SJ002)]$ git status
# On branch SJ002
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       .ruby-gemset
#       .ruby-version
nothing added to commit but untracked files present (use "git add" to track)
[arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-gemset
fatal: Unable to mark file .ruby-gemset
[arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-version
fatal: Unable to mark file .ruby-version
[arup@sztukajedzenia (SJ002)]$

Why it is throwing error ? And how to achieve this without taking the help of the file `.gitignore` ?

-- 
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

--Brian Kernighan

```

## t.gummerer@gmail.com, 2015-03-15 12:30

Subject: Re: fatal: Unable to mark file .ruby-version
Message-ID: <20150315123004.GB12619@hank>
URL: https://gitlist.dev/e/20150315123004.GB12619%40hank
In-Reply-To: <1645103.91WotSCBpm@linux-wzza.site>

```
Hi,

On 03/15, Arup Rakshit wrote:
> Hi,
> 
> I am trying to ignore 2 files, but getting error -
> 
> [arup@sztukajedzenia (SJ002)]$ git status
> # On branch SJ002
> # Untracked files:
> #   (use "git add <file>..." to include in what will be committed)
> #
> #       .ruby-gemset
> #       .ruby-version
> nothing added to commit but untracked files present (use "git add" to track)
> [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-gemset
> fatal: Unable to mark file .ruby-gemset
> [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-version
> fatal: Unable to mark file .ruby-version
> [arup@sztukajedzenia (SJ002)]$

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.

> Why it is throwing error ? And how to achieve this without taking
> the help of the file `.gitignore` ?

You can create a file .git/info/exclude in the root directory of the
repository with the same syntax as .gitignore to ignore these files.
This rules will not be commited in the repository.

> -- 
> ================
> Regards,
> Arup Rakshit
> ================
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
> 
> --Brian Kernighan
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

```

## Arup Rakshit, 2015-03-15 14:21

Subject: Re: fatal: Unable to mark file .ruby-version
Message-ID: <7217253.Nyz2WfkBbo@linux-wzza.site>
URL: https://gitlist.dev/e/7217253.Nyz2WfkBbo%40linux-wzza.site
In-Reply-To: <20150315123004.GB12619@hank>

```
On Sunday, March 15, 2015 01:30:04 PM you wrote:
> Hi,
> 
> On 03/15, Arup Rakshit wrote:
> > Hi,
> > 
> > I am trying to ignore 2 files, but getting error -
> > 
> > [arup@sztukajedzenia (SJ002)]$ git status
> > # On branch SJ002
> > # Untracked files:
> > #   (use "git add <file>..." to include in what will be committed)
> > #
> > #       .ruby-gemset
> > #       .ruby-version
> > nothing added to commit but untracked files present (use "git add" to track)
> > [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-gemset
> > fatal: Unable to mark file .ruby-gemset
> > [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-version
> > fatal: Unable to mark file .ruby-version
> > [arup@sztukajedzenia (SJ002)]$
> 
> 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 ?

> > Why it is throwing error ? And how to achieve this without taking
> > the help of the file `.gitignore` ?
> 
> You can create a file .git/info/exclude in the root directory of the
> repository with the same syntax as .gitignore to ignore these files.
> This rules will not be commited in the repository.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

--Brian Kernighan

```

## t.gummerer@gmail.com, 2015-03-15 16:58

Subject: Re: fatal: Unable to mark file .ruby-version
Message-ID: <20150315165819.GA17591@hank>
URL: https://gitlist.dev/e/20150315165819.GA17591%40hank
In-Reply-To: <7217253.Nyz2WfkBbo@linux-wzza.site>

```
On 03/15, Arup Rakshit wrote:
> On Sunday, March 15, 2015 01:30:04 PM you wrote:
> > Hi,
> > 
> > On 03/15, Arup Rakshit wrote:
> > > Hi,
> > > 
> > > I am trying to ignore 2 files, but getting error -
> > > 
> > > [arup@sztukajedzenia (SJ002)]$ git status
> > > # On branch SJ002
> > > # Untracked files:
> > > #   (use "git add <file>..." to include in what will be committed)
> > > #
> > > #       .ruby-gemset
> > > #       .ruby-version
> > > nothing added to commit but untracked files present (use "git add" to track)
> > > [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-gemset
> > > fatal: Unable to mark file .ruby-gemset
> > > [arup@sztukajedzenia (SJ002)]$ git update-index --assume-unchanged .ruby-version
> > > fatal: Unable to mark file .ruby-version
> > > [arup@sztukajedzenia (SJ002)]$
> > 
> > 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.

> > > Why it is throwing error ? And how to achieve this without taking
> > > the help of the file `.gitignore` ?
> > 
> > You can create a file .git/info/exclude in the root directory of the
> > repository with the same syntax as .gitignore to ignore these files.
> > This rules will not be commited in the repository.
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe git" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -- 
> ================
> Regards,
> Arup Rakshit
> ================
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
> 
> --Brian Kernighan
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Thomas Gummerer

```

## Kevin D, 2015-03-15 17:45

Subject: Re: fatal: Unable to mark file .ruby-version
Message-ID: <20150315174543.GA11832@vps892.directvps.nl>
URL: https://gitlist.dev/e/20150315174543.GA11832%40vps892.directvps.nl
In-Reply-To: <20150315165819.GA17591@hank>

```
On Sun, Mar 15, 2015 at 05:58:19PM +0100, t.gummerer@gmail.com wrote:
> 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

```

## Arup Rakshit, 2015-03-16 05:29

Subject: Re: fatal: Unable to mark file .ruby-version
Message-ID: <186241547.130512.1426483752551.JavaMail.yahoo@mail.yahoo.com>
URL: https://gitlist.dev/e/186241547.130512.1426483752551.JavaMail.yahoo%40mail.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:
> 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

```
