{"thread":{"id":"33865","subject":".gitignore behavior on Mac","startedAt":"2013-05-18T18:36:42Z","lastAt":"2013-05-19T10:54:36Z","messageCount":8,"participants":["Peter Lauri","John Keeping","Johannes Sixt","Junio C Hamano","Antony Male"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"217823","messageId":"CAEe6bfD_1GjMBByaEFQ4RMTMaz8XZvd00mxyfaAHtXVpbUjj6A@mail.gmail.com","threadId":"33865","inReplyTo":null,"subject":".gitignore behavior on Mac","fromName":"Peter Lauri","fromEmail":"peterlauri@gmail.com","sentAt":"2013-05-18T18:36:42Z","receivedAt":"2013-05-18T18:36:42Z","isPatch":false,"sender":{"key":"peterlauri@gmail.com","avatar":"https://gravatar.com/avatar/5f8f6db04a8eb167fe52ee9e5891a10e360d39cf9ee511811423bd373d116e67?d=mp&s=160"},"body":"Shouldn't this be valid? I would expect to NOT see the\ncore/inc/config.inc.php in the \"git status\" output...\n\nPeters-MacBook-Air:dt-git plauri$ cat .gitignore\n.buildpath\n.project\n.settings/\nweb/pjotr.php\ncore/inc/config.inc.php\ndt_error.log\nprocess_wrapper.sh\n\nPeters-MacBook-Air:dt-git plauri$ git status\n# On branch local/DT-7_gantt\n# Changes not staged for commit:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n# modified:   .gitignore\n# modified:   core/inc/config.inc.php\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n# out.ionel\n# tree.py\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\nPeters-MacBook-Air:dt-git plauri$\n"},{"id":"217824","messageId":"20130518184136.GH27005@serenity.lan","threadId":"33865","inReplyTo":"CAEe6bfD_1GjMBByaEFQ4RMTMaz8XZvd00mxyfaAHtXVpbUjj6A@mail.gmail.com","subject":"Re: .gitignore behavior on Mac","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-18T18:41:36Z","receivedAt":"2013-05-18T18:41:36Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sat, May 18, 2013 at 08:36:42PM +0200, Peter Lauri wrote:\n> Shouldn't this be valid? I would expect to NOT see the\n> core/inc/config.inc.php in the \"git status\" output...\n> \n> Peters-MacBook-Air:dt-git plauri$ cat .gitignore\n> .buildpath\n> .project\n> .settings/\n> web/pjotr.php\n> core/inc/config.inc.php\n> dt_error.log\n> process_wrapper.sh\n> \n> Peters-MacBook-Air:dt-git plauri$ git status\n> # On branch local/DT-7_gantt\n> # Changes not staged for commit:\n> #   (use \"git add <file>...\" to update what will be committed)\n> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n> #\n> # modified:   .gitignore\n> # modified:   core/inc/config.inc.php\n\ncore/inc/config.inc.php is already in the repository.  Git won't ignore\nfiles that are already tracked.\n\nIf you remove the file from the index:\n\n    git rm --cached core/inc/config.inc.php\n\nthen you'll see it as deleted in \"git status\" but it won't appear in the\nuntracked files section even though it's still there in the working\ntree.\n\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> # out.ionel\n> # tree.py\n> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> Peters-MacBook-Air:dt-git plauri$\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"217826","messageId":"CAEe6bfB30aD0LcgR4fzLy=xJGwzASJpgfvvtoTmFmJ1_2HZ4Jg@mail.gmail.com","threadId":"33865","inReplyTo":"20130518184136.GH27005@serenity.lan","subject":"Re: .gitignore behavior on Mac","fromName":"Peter Lauri","fromEmail":"peterlauri@gmail.com","sentAt":"2013-05-18T18:43:57Z","receivedAt":"2013-05-18T18:43:57Z","isPatch":false,"sender":{"key":"peterlauri@gmail.com","avatar":"https://gravatar.com/avatar/5f8f6db04a8eb167fe52ee9e5891a10e360d39cf9ee511811423bd373d116e67?d=mp&s=160"},"body":"But I just don't want to see that darn file. It is a config file that\nI have changed, and I don't want to need to stash it for each \"git\nsvn\" action I want to perform... Any solution for that?\n\nOn Sat, May 18, 2013 at 8:41 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Sat, May 18, 2013 at 08:36:42PM +0200, Peter Lauri wrote:\n>> Shouldn't this be valid? I would expect to NOT see the\n>> core/inc/config.inc.php in the \"git status\" output...\n>>\n>> Peters-MacBook-Air:dt-git plauri$ cat .gitignore\n>> .buildpath\n>> .project\n>> .settings/\n>> web/pjotr.php\n>> core/inc/config.inc.php\n>> dt_error.log\n>> process_wrapper.sh\n>>\n>> Peters-MacBook-Air:dt-git plauri$ git status\n>> # On branch local/DT-7_gantt\n>> # Changes not staged for commit:\n>> #   (use \"git add <file>...\" to update what will be committed)\n>> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n>> #\n>> # modified:   .gitignore\n>> # modified:   core/inc/config.inc.php\n>\n> core/inc/config.inc.php is already in the repository.  Git won't ignore\n> files that are already tracked.\n>\n> If you remove the file from the index:\n>\n>     git rm --cached core/inc/config.inc.php\n>\n> then you'll see it as deleted in \"git status\" but it won't appear in the\n> untracked files section even though it's still there in the working\n> tree.\n>\n>> # Untracked files:\n>> #   (use \"git add <file>...\" to include in what will be committed)\n>> #\n>> # out.ionel\n>> # tree.py\n>> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n>> Peters-MacBook-Air:dt-git plauri$\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"217827","messageId":"20130518185507.GI27005@serenity.lan","threadId":"33865","inReplyTo":"CAEe6bfB30aD0LcgR4fzLy=xJGwzASJpgfvvtoTmFmJ1_2HZ4Jg@mail.gmail.com","subject":"Re: .gitignore behavior on Mac","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-18T18:55:07Z","receivedAt":"2013-05-18T18:55:07Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sat, May 18, 2013 at 08:43:57PM +0200, Peter Lauri wrote:\n> But I just don't want to see that darn file. It is a config file that\n> I have changed, and I don't want to need to stash it for each \"git\n> svn\" action I want to perform... Any solution for that?\n\nRead about --assume-unchanged in git-update-index(1).\n"},{"id":"217830","messageId":"5197EC19.8080806@kdbg.org","threadId":"33865","inReplyTo":"20130518185507.GI27005@serenity.lan","subject":"Re: .gitignore behavior on Mac","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-05-18T21:01:13Z","receivedAt":"2013-05-18T21:01:13Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 18.05.2013 20:55, schrieb John Keeping:\n> On Sat, May 18, 2013 at 08:43:57PM +0200, Peter Lauri wrote:\n>> But I just don't want to see that darn file. It is a config file that\n>> I have changed, and I don't want to need to stash it for each \"git\n>> svn\" action I want to perform... Any solution for that?\n> \n> Read about --assume-unchanged in git-update-index(1).\n\nBeware!! --assume-unchanged is a promise not to modify a file, but that\nis not true in this case, because it *was* modified. It might hide the\nfile from the git-status output, but then git might do something\nunexpected sometimes, because a promise was not kept.\n\nSee last paragraph of\nhttp://article.gmane.org/gmane.comp.version-control.git/146353\n\n-- Hannes\n"},{"id":"217835","messageId":"CAEe6bfC6F3sN_OXZYo1=bdwo01_7qFUEmbSWVFNaFZQrZUGdWA@mail.gmail.com","threadId":"33865","inReplyTo":"5197EC19.8080806@kdbg.org","subject":"Re: .gitignore behavior on Mac","fromName":"Peter Lauri","fromEmail":"peterlauri@gmail.com","sentAt":"2013-05-18T22:37:02Z","receivedAt":"2013-05-18T22:37:02Z","isPatch":false,"sender":{"key":"peterlauri@gmail.com","avatar":"https://gravatar.com/avatar/5f8f6db04a8eb167fe52ee9e5891a10e360d39cf9ee511811423bd373d116e67?d=mp&s=160"},"body":"Great, I have gotten the concept now :)\n\nMy workaround for my problem is to rename the file to ....default and\nthen all will work out well :) Copy the file then and locally modify\nit, but it will be in .gitignore so not tracked :)\n\nOn Sat, May 18, 2013 at 11:01 PM, Johannes Sixt <j6t@kdbg.org> wrote:\n> Am 18.05.2013 20:55, schrieb John Keeping:\n>> On Sat, May 18, 2013 at 08:43:57PM +0200, Peter Lauri wrote:\n>>> But I just don't want to see that darn file. It is a config file that\n>>> I have changed, and I don't want to need to stash it for each \"git\n>>> svn\" action I want to perform... Any solution for that?\n>>\n>> Read about --assume-unchanged in git-update-index(1).\n>\n> Beware!! --assume-unchanged is a promise not to modify a file, but that\n> is not true in this case, because it *was* modified. It might hide the\n> file from the git-status output, but then git might do something\n> unexpected sometimes, because a promise was not kept.\n>\n> See last paragraph of\n> http://article.gmane.org/gmane.comp.version-control.git/146353\n>\n> -- Hannes\n>\n"},{"id":"217848","messageId":"7vd2snza12.fsf@alter.siamese.dyndns.org","threadId":"33865","inReplyTo":"CAEe6bfC6F3sN_OXZYo1=bdwo01_7qFUEmbSWVFNaFZQrZUGdWA@mail.gmail.com","subject":"Re: .gitignore behavior on Mac","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-19T07:47:05Z","receivedAt":"2013-05-19T07:47:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Lauri <peterlauri@gmail.com> writes:\n\n> Great, I have gotten the concept now :)\n>\n> My workaround for my problem is to rename the file to ....default and\n> then all will work out well :) Copy the file then and locally modify\n> it, but it will be in .gitignore so not tracked :)\n\nI think it is not even an workaround but is a solid software\nconfiguration practice that is recommended.\n"},{"id":"217869","messageId":"5198AF6C.8080402@gmail.com","threadId":"33865","inReplyTo":"CAEe6bfC6F3sN_OXZYo1=bdwo01_7qFUEmbSWVFNaFZQrZUGdWA@mail.gmail.com","subject":"Re: .gitignore behavior on Mac","fromName":"Antony Male","fromEmail":"antony.male@gmail.com","sentAt":"2013-05-19T10:54:36Z","receivedAt":"2013-05-19T10:54:36Z","isPatch":false,"sender":{"key":"antony.male@gmail.com","avatar":"https://gravatar.com/avatar/44ebc98c2d05837be689ed72514f8119844424a9cf099e5202be4190281982f1?d=mp&s=160"},"body":"On 18/05/2013 23:37, Peter Lauri wrote:\n> Great, I have gotten the concept now :)\n>\n> My workaround for my problem is to rename the file to ....default and\n> then all will work out well :) Copy the file then and locally modify\n> it, but it will be in .gitignore so not tracked :)\n\nOver in the #git IRC channel, we point users asking this question to \nhttps://gist.github.com/canton7/1423106. It contains that approach, and \nquite a few others.\n\nAntony\n"}]}