{"thread":{"id":"38445","subject":"git pull not ignoring the file which has been sent to the temporary ignore list","startedAt":"2015-01-23T18:27:30Z","lastAt":"2015-01-24T11:03:41Z","messageCount":10,"participants":["Arup Rakshit","Junio C Hamano","Stefan Beller","Kevin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"255210","messageId":"3278910.5D06XWKxyS@linux-wzza.site","threadId":"38445","inReplyTo":null,"subject":"git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2015-01-23T18:27:30Z","receivedAt":"2015-01-23T18:27:30Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"Hi,\n\nI asked git not to track any changes to the file .gitignore. To do so I did use the command - git update-index --assume-unchanged .gitignore.\n\n[arup@sztukajedzenia]$ git status\n# On branch MajorUpgrade\n# Your branch is behind 'origin/MajorUpgrade' by 4 commits, and can be fast-forwarded.\n#   (use \"git pull\" to update your local branch)\n#\nnothing to commit, working directory clean\n[arup@sztukajedzenia]$ git pull origin MajorUpgrade\nFrom rubyxcube.co.uk:sztuka-jedzenia/sztukajedzenia\n * branch            MajorUpgrade -> FETCH_HEAD\nUpdating 59a1c07..d7b9cd3\nerror: Your local changes to the following files would be overwritten by merge:\n        .gitignore\nPlease, commit your changes or stash them before you can merge.\nAborting\n[arup@sztukajedzenia]$\n\nBut you can see above, while I am taking `pull`, it is considering the file .gitignore. How should I tell `git pull` also not to consider the change the file, and skip it or something else ?\n\n-- \n================\nRegards,\nArup Rakshit\n================\nDebugging 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.\n\n--Brian Kernighan\n"},{"id":"255212","messageId":"4004424.cytMaov38D@linux-wzza.site","threadId":"38445","inReplyTo":"xmqqiofxqoo3.fsf@gitster.dls.corp.google.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2015-01-23T18:35:53Z","receivedAt":"2015-01-23T18:35:53Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"On Friday, January 23, 2015 11:31:40 AM you wrote:\n> Arup Rakshit <aruprakshit@rocketmail.com> writes:\n> \n> > I asked git not to track any changes to the file .gitignore. To do\n> > so I did use the command - git update-index --assume-unchanged\n> > .gitignore.\n> \n> You are not asking Git to do anything. You promised Git that you\n> will make no changes to .gitignore, and then broke that promise.\n> \n> Assume-unchanged is *not* \"Ignore changes to this path\".\n\nOk. How should I then ignore any local changes to the .gitignore file ? And while taking pull, git should skip this file ?\n-- \n================\nRegards,\nArup Rakshit\n================\nDebugging 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.\n\n--Brian Kernighan\n"},{"id":"255211","messageId":"xmqqiofxqoo3.fsf@gitster.dls.corp.google.com","threadId":"38445","inReplyTo":"3278910.5D06XWKxyS@linux-wzza.site","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-23T19:31:40Z","receivedAt":"2015-01-23T19:31:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Arup Rakshit <aruprakshit@rocketmail.com> writes:\n\n> I asked git not to track any changes to the file .gitignore. To do\n> so I did use the command - git update-index --assume-unchanged\n> .gitignore.\n\nYou are not asking Git to do anything. You promised Git that you\nwill make no changes to .gitignore, and then broke that promise.\n\nAssume-unchanged is *not* \"Ignore changes to this path\".\n"},{"id":"255222","messageId":"CAGZ79kbk=DFcMSVtnWHw7Vn-xm4q4x5T_9qiPrqt5oN1DMhFSw@mail.gmail.com","threadId":"38445","inReplyTo":"4004424.cytMaov38D@linux-wzza.site","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-23T20:12:26Z","receivedAt":"2015-01-23T20:12:26Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jan 23, 2015 at 10:35 AM, Arup Rakshit\n<aruprakshit@rocketmail.com> wrote:\n> On Friday, January 23, 2015 11:31:40 AM you wrote:\n>> Arup Rakshit <aruprakshit@rocketmail.com> writes:\n>>\n>> > I asked git not to track any changes to the file .gitignore. To do\n>> > so I did use the command - git update-index --assume-unchanged\n>> > .gitignore.\n>>\n>> You are not asking Git to do anything. You promised Git that you\n>> will make no changes to .gitignore, and then broke that promise.\n>>\n>> Assume-unchanged is *not* \"Ignore changes to this path\".\n>\n> Ok. How should I then ignore any local changes to the .gitignore file ? And while taking pull, git should skip this file ?\n\nLook at .git/info/exclude\n\nWhen looking for a reference to that path (I am bad at remembering\nwhich man page that is)\nI found https://help.github.com/articles/ignoring-files/ as Googles\nfirst hit, which advises to use\n    git update-index --assume-unchanged path/to/file.txt\nNot sure if that is most helpful advice there.\n\nSee http://git-scm.com/docs/gitignore instead\n"},{"id":"255223","messageId":"xmqq8ugtqjxg.fsf@gitster.dls.corp.google.com","threadId":"38445","inReplyTo":"CAGZ79kbk=DFcMSVtnWHw7Vn-xm4q4x5T_9qiPrqt5oN1DMhFSw@mail.gmail.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-23T21:14:03Z","receivedAt":"2015-01-23T21:14:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>> Ok. How should I then ignore any local changes to the .gitignore\n>> file ? And while taking pull, git should skip this file ?\n>\n> Look at .git/info/exclude\n\nGood answer for \".gitignore\".  In general, you do not \"ignore local\nchanges\" to tracked paths.\n\n> I found https://help.github.com/articles/ignoring-files/ as Googles\n> first hit, which advises to use\n>     git update-index --assume-unchanged path/to/file.txt\n> Not sure if that is most helpful advice there.\n\nThe piece of advice in the last paragraph on that page is wrong (and\nit has been wrong from the day it was written).\n\nThe gitignore(5) documentation used to have a similar incorrect\npiece of advice but we finally corrected it recently.\n\nCf. http://thread.gmane.org/gmane.comp.version-control.git/260954/focus=261118\n"},{"id":"255225","messageId":"CAGZ79kaJkDjr7uPScKgO=P5nVZ4sQgn1aQNf9MwVuHMcA4a2NQ@mail.gmail.com","threadId":"38445","inReplyTo":"xmqq8ugtqjxg.fsf@gitster.dls.corp.google.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-23T21:38:55Z","receivedAt":"2015-01-23T21:38:55Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jan 23, 2015 at 1:14 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Good answer for \".gitignore\".  In general, you do not \"ignore local\n> changes\" to tracked paths.\n>\n\nI assumed Arup would want to ignore more than is in the upstream project,\nso you'd come up with an appendix to the .gitignore file because that file\nis rather obvious to find (it's printed when git pull modifies it,\n'ls' just find it,\nyou'd not look into .git/info/exclude by chance)\n\nAssuming you want to ignore less than the upstream project (delete some\nlines from .gitignore) it get's tricky in my opinion. Either have a local commit\nand just use 'git pull' to resolve the conflicts with upstream. The problem then\narises if you want to publish your changes (such as pushing your changes and\ncreating a pull request, then you have that commit included, which you maybe\ndon't want to include)\n\nMind, that I am talking about possible work flows to circumvent an\nassumed problem\nwhich would result in problems as described in the first mail.\n"},{"id":"255230","messageId":"xmqq4mrhqgl4.fsf@gitster.dls.corp.google.com","threadId":"38445","inReplyTo":"CAGZ79kaJkDjr7uPScKgO=P5nVZ4sQgn1aQNf9MwVuHMcA4a2NQ@mail.gmail.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-23T22:26:15Z","receivedAt":"2015-01-23T22:26:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> Assuming you want to ignore less than the upstream project (delete some\n> lines from .gitignore) it get's tricky in my opinion.\n\nWhy?  Doesn't info/exclude allow negative ignore patterns?\n"},{"id":"255232","messageId":"CAGZ79kaNHjAna3PBxMEfZV1dfZnoohst1Ky5aSkCi+v4NBcN=w@mail.gmail.com","threadId":"38445","inReplyTo":"xmqq4mrhqgl4.fsf@gitster.dls.corp.google.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-23T22:32:33Z","receivedAt":"2015-01-23T22:32:33Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jan 23, 2015 at 2:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stefan Beller <sbeller@google.com> writes:\n>\n>> Assuming you want to ignore less than the upstream project (delete some\n>> lines from .gitignore) it get's tricky in my opinion.\n>\n> Why?  Doesn't info/exclude allow negative ignore patterns?\n\nI used negative patterns only once, so they did not come to my mind today.\nApologies for not looking it up before replying. :(\n"},{"id":"255251","messageId":"1557175.bcUxN10iZq@linux-wzza.site","threadId":"38445","inReplyTo":"xmqq8ugtqjxg.fsf@gitster.dls.corp.google.com","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2015-01-24T03:50:46Z","receivedAt":"2015-01-24T03:50:46Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"On Friday, January 23, 2015 01:14:03 PM you wrote:\n> Stefan Beller <sbeller@google.com> writes:\n> \n> >> Ok. How should I then ignore any local changes to the .gitignore\n> >> file ? And while taking pull, git should skip this file ?\n> >\n> > Look at .git/info/exclude\n> \n> Good answer for \".gitignore\".  In general, you do not \"ignore local\n> changes\" to tracked paths.\n\nThere are some configuration files, like `database.yml`, where we generally put our local DB credentials and we don't want to share such things. That's why we always put related settings inside the .gitignore file. But  while I will change it, git will not track the changes of the file, but .gitignore. That's why I used the first thread command. But when the time the came to take a `git pull`, I got to know about the mess. What should be the ideal decision in this case ?\n\n> > I found https://help.github.com/articles/ignoring-files/ as Googles\n> > first hit, which advises to use\n> >     git update-index --assume-unchanged path/to/file.txt\n> > Not sure if that is most helpful advice there.\n\nYes, I followed the same.\n\n> The piece of advice in the last paragraph on that page is wrong (and\n> it has been wrong from the day it was written).\n> \n> The gitignore(5) documentation used to have a similar incorrect\n> piece of advice but we finally corrected it recently.\n> \n> Cf. http://thread.gmane.org/gmane.comp.version-control.git/260954/focus=261118\n\n-- \n================\nRegards,\nArup Rakshit\n================\nDebugging 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.\n\n--Brian Kernighan\n"},{"id":"255254","messageId":"20150124110341.GA15090@vps892.directvps.nl","threadId":"38445","inReplyTo":"1557175.bcUxN10iZq@linux-wzza.site","subject":"Re: git pull not ignoring the file which has been sent to the temporary ignore list","fromName":"Kevin","fromEmail":"compufreak@gmail.com","sentAt":"2015-01-24T11:03:41Z","receivedAt":"2015-01-24T11:03:41Z","isPatch":false,"sender":{"key":"compufreak@gmail.com","avatar":"https://gravatar.com/avatar/10ca3ab6beccce3bbb196f655727a5ece331d2c95062270ef9d52e64f0d9356b?d=mp&s=160"},"body":"On Sat, Jan 24, 2015 at 10:20:46AM +0630, Arup Rakshit wrote:\n> On Friday, January 23, 2015 01:14:03 PM you wrote:\n> \n> [..]\n>\n> There are some configuration files, like `database.yml`, where we\n> generally put our local DB credentials and we don't want to share such\n> things. That's why we always put related settings inside the\n> .gitignore file. But  while I will change it, git will not track the\n> changes of the file, but .gitignore. That's why I used the first\n> thread command. But when the time the came to take a `git pull`, I got\n> to know about the mess. What should be the ideal decision in this case\n> ?\n> \n\nIn an ideal sittuation, configuration data is not stored inside git,\nbecause this would tie the code only to one environment.\n\nSo what you would store in git is a template of the configuration data,\nthat can be used to create the actual config file that is used.\n\nThis way, you don't have any problems with having to change tracked\nfiles only for you local environment.\n"}]}