git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* fatal: Unable to mark file .ruby-version
@ 2015-03-15 10:01 Arup Rakshit
  2015-03-15 12:30 ` t.gummerer
  0 siblings, 1 reply; 6+ messages in thread
From: Arup Rakshit @ 2015-03-15 10:01 UTC (permalink / raw
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal: Unable to mark file .ruby-version
  2015-03-15 10:01 fatal: Unable to mark file .ruby-version Arup Rakshit
@ 2015-03-15 12:30 ` t.gummerer
  2015-03-15 14:21   ` Arup Rakshit
  0 siblings, 1 reply; 6+ messages in thread
From: t.gummerer @ 2015-03-15 12:30 UTC (permalink / raw
  To: Arup Rakshit; +Cc: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal: Unable to mark file .ruby-version
  2015-03-15 12:30 ` t.gummerer
@ 2015-03-15 14:21   ` Arup Rakshit
  2015-03-15 16:58     ` t.gummerer
  0 siblings, 1 reply; 6+ messages in thread
From: Arup Rakshit @ 2015-03-15 14:21 UTC (permalink / raw
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal: Unable to mark file .ruby-version
  2015-03-15 14:21   ` Arup Rakshit
@ 2015-03-15 16:58     ` t.gummerer
  2015-03-15 17:45       ` Kevin D
  0 siblings, 1 reply; 6+ messages in thread
From: t.gummerer @ 2015-03-15 16:58 UTC (permalink / raw
  To: Arup Rakshit; +Cc: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal: Unable to mark file .ruby-version
  2015-03-15 16:58     ` t.gummerer
@ 2015-03-15 17:45       ` Kevin D
  2015-03-16  5:29         ` Arup Rakshit
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin D @ 2015-03-15 17:45 UTC (permalink / raw
  To: Arup Rakshit; +Cc: t.gummerer, git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal: Unable to mark file .ruby-version
  2015-03-15 17:45       ` Kevin D
@ 2015-03-16  5:29         ` Arup Rakshit
  0 siblings, 0 replies; 6+ messages in thread
From: Arup Rakshit @ 2015-03-16  5:29 UTC (permalink / raw
  To: git@vger.kernel.org



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-16  5:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15 10:01 fatal: Unable to mark file .ruby-version Arup Rakshit
2015-03-15 12:30 ` t.gummerer
2015-03-15 14:21   ` Arup Rakshit
2015-03-15 16:58     ` t.gummerer
2015-03-15 17:45       ` Kevin D
2015-03-16  5:29         ` Arup Rakshit

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).