{"thread":{"id":"43274","subject":"Re: Ignoring local changes","startedAt":"2006-12-14T16:26:06Z","lastAt":"2006-12-15T00:15:53Z","messageCount":7,"participants":["Johannes Schindelin","Pazu","Rogan Dawes","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"294214","messageId":"loom.20061214T171948-279@post.gmane.org","threadId":"43274","inReplyTo":null,"subject":"Ignoring local changes","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-12-14T16:26:06Z","receivedAt":"2006-12-14T16:26:06Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Is there any way to make git completely ignore changes to certain local files? I\nknow about .gitignore, but that doesn't work when the files I want to ignore\nwere already added to the repository.\n\nA little more context should help you understand my need. I'm currently tracking\na big subversion repository using git-svn; I do all my develop on local git\nbranches, and later use git-svn dcommit to push these changes to the svn\nrepository. \n\nThere are some files in the svn repository (and by extension, on my local\nmirrored repository) that are almost always locally modified (eclipse/IDEA\nproject files or generated artifacts that someone else added to svn), but I\nalmost never want to commit then. This is a hassle in several situations:\n\n1) git-status always show these files as modified, polluting the output and\nmaking it harder for me to pinpoint the \"real\" changes.\n2) git-rebase refuses to run, since the working copy will always be dirty*\n3) since git-svn dcommit uses git-rebase, sometimes it fails for the same reason.\n\nSo, is there any way to make git look the other way regarding these files?\n\n* I usually get around this making a local commit with the local modifications,\nrebasing, and the using git-reset to revert the last commit.\n\n-- Pazu\n"},{"id":"297941","messageId":"45817F8A.3050701@op5.se","threadId":"43274","inReplyTo":"loom.20061214T171948-279@post.gmane.org","subject":"Re: Ignoring local changes","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-12-14T16:44:58Z","receivedAt":"2006-12-14T16:44:58Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Pazu wrote:\n> Is there any way to make git completely ignore changes to certain local files? I\n> know about .gitignore, but that doesn't work when the files I want to ignore\n> were already added to the repository.\n> \n\nYes it does. Just add the file to .gitignore and it won't be noticed\nanymore.\n\nCorrection: I just tested this, and while git-add won't touch the file, \ngit-update-index will, and git-status still shows it as modified.\n\nThis feels like a bug to me.\n\n> A little more context should help you understand my need. I'm currently tracking\n> a big subversion repository using git-svn; I do all my develop on local git\n> branches, and later use git-svn dcommit to push these changes to the svn\n> repository. \n> \n> There are some files in the svn repository (and by extension, on my local\n> mirrored repository) that are almost always locally modified (eclipse/IDEA\n> project files or generated artifacts that someone else added to svn), but I\n> almost never want to commit then. This is a hassle in several situations:\n> \n> 1) git-status always show these files as modified, polluting the output and\n> making it harder for me to pinpoint the \"real\" changes.\n> 2) git-rebase refuses to run, since the working copy will always be dirty*\n> 3) since git-svn dcommit uses git-rebase, sometimes it fails for the same reason.\n> \n> So, is there any way to make git look the other way regarding these files?\n> \n\nman git-ls-files, search for .git/info/exclude and see if that works for \nyou.\n\nOn a side-note, it would be neat if it was possible to set \n--exclude-per-directory as a config option. It would save an awful lot \nof hassle for imported repositories. Even more so if \ngit-{cvs,svn,p4}import and the lot set it up automagically.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\n"},{"id":"294455","messageId":"9e7ab7380612140855p1f4ee6c1l5ef24c4d1d169da6@mail.gmail.com","threadId":"43274","inReplyTo":"45817F8A.3050701@op5.se","subject":"Re: Ignoring local changes","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-12-14T16:55:32Z","receivedAt":"2006-12-14T16:55:32Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"2006/12/14, Andreas Ericsson <ae@op5.se>:\n\n> Correction: I just tested this, and while git-add won't touch the file,\n> git-update-index will, and git-status still shows it as modified.\n\nYes, and that's exactly my problems. There are a number of\nmodified/removed files in my working copy that were previously added\nto the repository, and git-status shows them as modified/removed, even\nwhen they're listed in .gitignore or .git/info/exclude\n\n> This feels like a bug to me.\n\nDunno, sounds like this is by design. I acknowledge that my situation\nis unusual, and most often, you'll want to always track a file once\nit's been added to the repository.\n\n"},{"id":"295172","messageId":"4581C1D4.7080102@dawes.za.net","threadId":"43274","inReplyTo":"9e7ab7380612140855p1f4ee6c1l5ef24c4d1d169da6@mail.gmail.com","subject":"Re: Ignoring local changes","fromName":"Rogan Dawes","fromEmail":"discard@dawes.za.net","sentAt":"2006-12-14T21:27:48Z","receivedAt":"2006-12-14T21:27:48Z","isPatch":false,"sender":{"key":"discard@dawes.za.net","avatar":null},"body":"Pazu wrote:\n> 2006/12/14, Andreas Ericsson <ae@op5.se>:\n> \n>> Correction: I just tested this, and while git-add won't touch the file,\n>> git-update-index will, and git-status still shows it as modified.\n> \n> Yes, and that's exactly my problems. There are a number of\n> modified/removed files in my working copy that were previously added\n> to the repository, and git-status shows them as modified/removed, even\n> when they're listed in .gitignore or .git/info/exclude\n> \n>> This feels like a bug to me.\n> \n> Dunno, sounds like this is by design. I acknowledge that my situation\n> is unusual, and most often, you'll want to always track a file once\n> it's been added to the repository.\n> \n> -- Pazu\n\nWhy not remove it from the repo, then set .gitignore?\n\nIf it is generated code, or compiled code, it probably shouldn't be in \nthe repo in the first place . . . Simply correct that mistake, and you \nare good to go.\n\n"},{"id":"296452","messageId":"9e7ab7380612141336p3b930047l3a4a76947239162f@mail.gmail.com","threadId":"43274","inReplyTo":"4581C1D4.7080102@dawes.za.net","subject":"Re: Ignoring local changes","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-12-14T21:36:51Z","receivedAt":"2006-12-14T21:36:51Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"2006/12/14, Rogan Dawes <discard@dawes.za.net>:\n\n> Why not remove it from the repo, then set .gitignore?\n>\n> If it is generated code, or compiled code, it probably shouldn't be in\n> the repo in the first place . . . Simply correct that mistake, and you\n> are good to go.\n\nBasically, because I don't want to mess with the upstream. I know, I\ncan remove them only from my local branch, and never push the commit\nthat removed the files, and that's what I'll probably do if there's no\nother way -- but it would be best if I could just ignore the files. It\ndoesn't sound unreasonable, does it?\n\n"},{"id":"297759","messageId":"loom.20061214T225308-91@post.gmane.org","threadId":"43274","inReplyTo":"9e7ab7380612141336p3b930047l3a4a76947239162f@mail.gmail.com","subject":"Re: Ignoring local changes","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-12-14T21:56:25Z","receivedAt":"2006-12-14T21:56:25Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Pazu <pazu <at> pazu.com.br> writes:\n\n> I know, could remove them only from my local branch, and never push the\n> commit that removed the files…\n\nAnd that makes me think about yet another nice feature: configure git[-svn] to\n\"block\" a commit, meaning that a blocked commit would never be pushed out when\ndoing a git push or git-svn dcommit.\n\n-- Pazu\n"},{"id":"294194","messageId":"Pine.LNX.4.63.0612150114030.3635@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43274","inReplyTo":"9e7ab7380612141336p3b930047l3a4a76947239162f@mail.gmail.com","subject":"Re: Ignoring local changes","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-15T00:15:53Z","receivedAt":"2006-12-15T00:15:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 14 Dec 2006, Pazu wrote:\n\n> 2006/12/14, Rogan Dawes <discard@dawes.za.net>:\n> \n> > Why not remove it from the repo, then set .gitignore?\n> > \n> > If it is generated code, or compiled code, it probably shouldn't be in\n> > the repo in the first place . . . Simply correct that mistake, and you\n> > are good to go.\n> \n> Basically, because I don't want to mess with the upstream. I know, I\n> can remove them only from my local branch, and never push the commit\n> that removed the files, and that's what I'll probably do if there's no\n> other way -- but it would be best if I could just ignore the files. It\n> doesn't sound unreasonable, does it?\n\nIt is not unreasonable. But I could not find an easy way to do it with \ngit. It should be easy to hack it into it, though.\n\nCiao,\nDscho\n"}]}