Re: Ignoring local changes

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

 



Pazu wrote:
Andreas Ericsson <ae <at> op5.se> writes:

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.

Following up to a very old thread: how the situation described above stands
today? I've been away from git for a while, so I don't know if anything changed
recently about this. In short: I want a way to make 'git status' and 'git commit
-a' ignore some files, even if they're already added to the repository.

My upstream repository (managed by SVN; imported to git using git-svn) contains
many files that are spuriously changed by IDE's and other tools, so they will
almost aways show up as modified by git, and yet, 99% of the time I don't want
to commit them. It's a pain to go through that huge list of files in 'git
status' to add stage only one or two files for commit.


I think that if you need help to remember which two files you edited you're in
bigger trouble than git can help you solve ;-)

	git commit file1 file2

will work wonders in your case.

Otherwise, use .git/info/exclude (or some such, the exact name eludes me) to
mark the IDE-modified files. That will work just the same as .gitignore though,
so you won't be able to commit them later either.

Out of curiousity; Why does the IDE change those files if they're part of the
project? If they *are* part of the project, why use an IDE that changes your
source unless you want it to?

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

  Powered by Linux