Re: gitignore design

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



llucianf <llucianf@xxxxxxxxx> writes:
> Ferry Huberts <mailings@xxxxxxxxx> writes:
> > On 07/29/2011 12:20 PM, llucianf wrote:

> > > why gitignore doesnt simply work like in cvs where if you put something in
> > > the ignore file, those stuff are simply ignored from that point without
> > > having to remove them from repo?

Are you sure that cvsignore file makes CVS to ignore changes in
_tracked_ files (in repository)?  CVS manual says:

  Ignoring files via cvsignore
  ============================

     There are certain file names that frequently occur inside your
  working copy, but that you don't want to put under CVS control.
  Examples are all the object files that you get while you compile your
  sources.  Normally, when you run `cvs update', it prints a line for
  each file it encounters that it doesn't know about.

Tracked files (in repository) are by definition not unknown to version
control system, be it CVS or Git.
 
> > because when it's in the repo you obviously want to track it...
> > tracking trumps ignoring
> > 
> > if you now suddenly do not want to track it anymore you have to remove
> > it and ignore it.
>
> sorry but this is not always the case.

But it is _usually_ the case, and that is why gitignore works as it
does, being only about _untracked_ files.

>                                        there are plenty of cases (project
> files is most common example) in which i need files in repo but i do not
> need git to track them. so why i cant just simply enumerate those project
> files into .gitignore and 'persuade'  git to simply forget about them?

For that you can use 'assume-unachanged' mechanism (note: it is local
to repository).  The gitignore(7) manpage says:

  NOTES
     The purpose of gitignore files is to ensure that certain files not tracked
     by git remain untracked.

     To ignore uncommitted changes in a file that is already tracked, use
     `git update-index --assume-unchanged <file>`.


Or just don't use 'git commit -a' and commit with dirty tree.

-- 
Jakub Narębski

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]