{"thread":{"id":"10362","subject":"git-merge: need a tap with the cluestick, please","startedAt":"2007-10-18T16:17:55Z","lastAt":"2007-10-19T01:00:58Z","messageCount":3,"participants":["walt","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56412","messageId":"ff80tr$hh1$1@ger.gmane.org","threadId":"10362","inReplyTo":null,"subject":"git-merge: need a tap with the cluestick, please","fromName":"walt","fromEmail":"wa1ter@myrealbox.com","sentAt":"2007-10-18T16:17:55Z","receivedAt":"2007-10-18T16:17:55Z","isPatch":false,"sender":{"key":"wa1ter@myrealbox.com","avatar":null},"body":"I just tried my first local modification to Linus's tree, and I\ncan't get the merge to work.  Maybe my whole approach is wrong?\n\nI wanted start compiling the kernel out-of-tree, so I added my\nown 'obj' directory at the top level.\n\nI then got conflicts when trying to pull from Linus, so I added\nmy 'obj' directory to my toplevel .gitignore file and committed\nthe local change to my 'master' branch.  (This is my only local\nmodification because I'm only tracking Linus, not developing the\nkernel.)\n\nNow when I pull from Linus the merge stops in the middle because of\nconflicts with my .gitignore file <sigh>.  Anything I try now with\ngit-merge tells me I can't do that in the middle of a conflicted\nmerge.  Yes, I know that now, but what should I do instead?\n\nI could move my 'obj' out-of-tree but then I wouldn't learn anything.\nThis has to be bone-head easy, but not for me :)\n\nClues most welcome.\n"},{"id":"56444","messageId":"20071018233518.GL14735@spearce.org","threadId":"10362","inReplyTo":"ff80tr$hh1$1@ger.gmane.org","subject":"Re: git-merge: need a tap with the cluestick, please","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-18T23:35:18Z","receivedAt":"2007-10-18T23:35:18Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"walt <wa1ter@myrealbox.com> wrote:\n> Now when I pull from Linus the merge stops in the middle because of\n> conflicts with my .gitignore file <sigh>.  Anything I try now with\n> git-merge tells me I can't do that in the middle of a conflicted\n> merge.  Yes, I know that now, but what should I do instead?\n> \n> I could move my 'obj' out-of-tree but then I wouldn't learn anything.\n> This has to be bone-head easy, but not for me :)\n\nHow about putting the ignore for your obj dir in your own private\nexclude file:\n\n  $ echo /obj >>.git/info/exclude\n\nwill cause Git to ignore an \"obj\" directory if it is found in the\ntop level of the repository.  And since this file is not actually\ntracked as part of the repository it will apply to all branches\nin this repository and won't cause merge conflicts when upstream\nmakes changes to .gitignore.\n\nAs for aborting a merge that you have gotten into the middle of\ndecided you want to get out of, use `git reset --hard`.  That will\nthrow away all of the unmerged state and put you back to your\npre-merge state.\n\n-- \nShawn.\n"},{"id":"56457","messageId":"ff8vj9$rs4$1@ger.gmane.org","threadId":"10362","inReplyTo":"20071018233518.GL14735@spearce.org","subject":"Re: git-merge: need a tap with the cluestick, please","fromName":"walt","fromEmail":"wa1ter@myrealbox.com","sentAt":"2007-10-19T01:00:58Z","receivedAt":"2007-10-19T01:00:58Z","isPatch":false,"sender":{"key":"wa1ter@myrealbox.com","avatar":null},"body":"Shawn O. Pearce wrote:\n> walt <wa1ter@myrealbox.com> wrote:\n>> Now when I pull from Linus the merge stops in the middle because of\n>> conflicts with my .gitignore file <sigh>.  Anything I try now with\n>> git-merge tells me I can't do that in the middle of a conflicted\n>> merge.  Yes, I know that now, but what should I do instead?\n>>\n>> I could move my 'obj' out-of-tree but then I wouldn't learn anything.\n>> This has to be bone-head easy, but not for me :)\n> \n> How about putting the ignore for your obj dir in your own private\n> exclude file:\n> \n>   $ echo /obj >>.git/info/exclude\n> \n> will cause Git to ignore an \"obj\" directory if it is found in the\n> top level of the repository.  And since this file is not actually\n> tracked as part of the repository it will apply to all branches\n> in this repository and won't cause merge conflicts when upstream\n> makes changes to .gitignore.\n\nThanks to both you and Lars, who gave me the same advice off-list.\nI will do exactly that.\n\nJust to illustrate how much of life depends on blind luck, both good\nand bad, I'll explain what really got me in trouble here.  On the\nvery first pull from Linus after I added my obj directory to\n.gitignore -- I pulled this commit:\n\ncommit 9e447a7f1fd997bcb9266899e777c37469245365\nAuthor: Denis V. Lunev <den@openvz.org>\nDate:   Tue Oct 16 11:22:21 2007 +0400\n\n     .gitignore update for x86 arch\n     This patch: - makes .gitignore files visible to git\n\nI'd like to think that if I'd made my changes on *any* other day\nbut yesterday I wouldn't have been so completely confused by what\nhappened.  (But perhaps I flatter myself :o)\n\nThanks again.\n"}]}