Skip to contentSkip to conversation

fatal: Unable to mark file .ruby-version

DISCUSSION Arup Rakshit 3 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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 ?

Signature · 7 lines
================
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
#1 lore raw

Hi,

Quoted 4 lines · Arup Rakshit

Hi,

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

Quoted 13 lines

[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.

Quoted 2 lines

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.

Quoted 12 lines
Signature · 11 lines
================
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 21 lines · you

Hi,

Quoted 4 lines · Arup Rakshit

Hi,

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

Quoted 13 lines

[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)]$

Quoted 4 lines

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 ?

Quoted 11 lines
Quoted 2 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 7 lines
================
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
#3 lore raw
Quoted 22 lines · Arup Rakshit
Quoted 21 lines · you

Hi,

Quoted 17 lines · Arup Rakshit

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)]$

Quoted 6 lines
Quoted 4 lines

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.

Quoted 24 lines
Quoted 11 lines
Quoted 2 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 11 lines
================
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Thomas Gummerer
#4 lore raw
Quoted 8 lines · On Sun, Mar 15, 2015 at 05:58:19PM +0100, [email protected] wrote:
Quoted 7 lines · Arup Rakshit
Quoted 5 lines · you

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.

Quoted 7 lines
Quoted 1 line

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

#5 lore raw

On Sunday, 15 March 2015 11:15 PM, Kevin D <[email protected]> wrote:

Quoted 8 lines · On Sun, Mar 15, 2015 at 05:58:19PM +0100, [email protected] wrote:
Quoted 7 lines · Arup Rakshit
Quoted 5 lines · you

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.

Quoted 7 lines
Quoted 1 line

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