git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-merge: need a tap with the cluestick, please

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 18, 2007, 23:35 UTC
Message-ID
<20071018233518.GL14735@spearce.org>
In-Reply-To
<ff80tr$hh1$1@ger.gmane.org>
walt <wa1ter@myrealbox.com> wrote:
Show 7 quoted lines
> Now when I pull from Linus the merge stops in the middle because of
> conflicts with my .gitignore file <sigh>.  Anything I try now with
> git-merge tells me I can't do that in the middle of a conflicted
> merge.  Yes, I know that now, but what should I do instead?
> 
> I could move my 'obj' out-of-tree but then I wouldn't learn anything.
> This has to be bone-head easy, but not for me :)

How about putting the ignore for your obj dir in your own private exclude file:

  $ echo /obj >>.git/info/exclude

will cause Git to ignore an "obj" directory if it is found in the top level of the repository. And since this file is not actually tracked as part of the repository it will apply to all branches in this repository and won't cause merge conflicts when upstream makes changes to .gitignore.

As for aborting a merge that you have gotten into the middle of decided you want to get out of, use `git reset --hard`. That will throw away all of the unmerged state and put you back to your pre-merge state.

-- 
Shawn.
Previous: waltNext: walt
Message 2 of 3 in “git-merge: need a tap with the cluestick, please”
  1. waltOct 18, 2007
  2. Shawn O. PearceOct 18, 2007
  3. waltOct 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.