Re: Ignoring local changes

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

 



Pazu wrote:
Is there any way to make git completely ignore changes to certain local files? I
know about .gitignore, but that doesn't work when the files I want to ignore
were already added to the repository.


Yes it does. Just add the file to .gitignore and it won't be noticed
anymore.

Correction: I just tested this, and while git-add won't touch the file, git-update-index will, and git-status still shows it as modified.

This feels like a bug to me.

A little more context should help you understand my need. I'm currently tracking
a big subversion repository using git-svn; I do all my develop on local git
branches, and later use git-svn dcommit to push these changes to the svn
repository.
There are some files in the svn repository (and by extension, on my local
mirrored repository) that are almost always locally modified (eclipse/IDEA
project files or generated artifacts that someone else added to svn), but I
almost never want to commit then. This is a hassle in several situations:

1) git-status always show these files as modified, polluting the output and
making it harder for me to pinpoint the "real" changes.
2) git-rebase refuses to run, since the working copy will always be dirty*
3) since git-svn dcommit uses git-rebase, sometimes it fails for the same reason.

So, is there any way to make git look the other way regarding these files?


man git-ls-files, search for .git/info/exclude and see if that works for you.

On a side-note, it would be neat if it was possible to set --exclude-per-directory as a config option. It would save an awful lot of hassle for imported repositories. Even more so if git-{cvs,svn,p4}import and the lot set it up automagically.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
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]