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

Re: Now What?

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 3, 2005, 17:25 UTC
Message-ID
<Pine.LNX.4.64.0511030921111.27915@g5.osdl.org>
In-Reply-To
<20051103083840.GA28300@ebar091.ebar.dtu.dk>
On Thu, 3 Nov 2005, Peter Eriksen wrote:
Show 69 quoted lines
> 
> Here's one I've done too many times:
> 
> ~/git/git-core]cat .git/remotes/origin
> URL: git://git.kernel.org/pub/scm/git/git.git
> Pull: master:origin
> 
> ~/git/git-core]git-checkout maint
> ~/git/git-core]git pull
> Unpacking 222 objects
>  100% (222/222) done
> * committish: 9534f40bc42dd826cc26c8c8c84f6a8a5fc569f6
>   branch 'master' of git://git.kernel.org/pub/scm/git/git
> * refs/heads/origin: storing branch 'master' of
> * git://git.kernel.org/pub/scm/git/git
> Trying really trivial in-index merge...
> fatal: Merge requires file-level merging
> Nope.
> Trying simple merge.
> Simple merge failed, trying Automatic merge.
> Auto-merging Documentation/tutorial.txt.
> Auto-merging Makefile.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in Makefile.
> Auto-merging apply.c.
> Auto-merging cache.h.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in cache.h.
> Auto-merging clone-pack.c.
> Auto-merging connect.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in connect.c.
> Auto-merging daemon.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in daemon.c.
> Auto-merging debian/changelog.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in debian/changelog.
> Auto-merging fetch-pack.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in fetch-pack.c.
> Auto-merging git-branch.sh.
> Auto-merging git-checkout.sh.
> Auto-merging git-clone.sh.
> Auto-merging git-cvsimport.perl.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in git-cvsimport.perl.
> Auto-merging git-fetch.sh.
> Auto-merging git-parse-remote.sh.
> Auto-merging git-tag.sh.
> Auto-merging quote.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in quote.c.
> Auto-merging quote.h.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in quote.h.
> Auto-merging refs.c.
> Auto-merging rev-list.c.
> Auto-merging send-pack.c.
> Auto-merging sha1_name.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in sha1_name.c.
> Auto-merging upload-pack.c.
> merge: warning: conflicts during merge
> ERROR: Merge conflict in upload-pack.c.
> fatal: merge program failed
> Automatic merge failed; fix up by hand
> 
> Indeed, what now?
You can do two things:
 a) decide not to merge at all:
	git reset --hard
    and you're done. This is what you want to do when you just pulled the 
    wrong branch, for example.

IF you pulled the right branch, and you knew you had other changes through other pulls or because you just had done your own development, you want to look at:

 b) Try to resolve the merge. Do a "git diff" and look what was unresolved 
    (by looking for those bog-standard resolve conflict markers like 
    "<<<<< old ===== new >>>>>".
    Edit the conflicts by hand to what you want them to be, and do
	git commit --all
    to commit your manual merge.

Note that if you start doing (b) and you decide it's too much for you, you can always go back to (a) in the end and ask for help from the people involved.

			Linus
Previous: Daniel BarkalowNext: Junio C Hamano
Message 15 of 20 in “Now What?”
  1. Jon LoeligerNov 3, 2005
  2. Chris ShoemakerNov 3, 2005
  3. Junio C HamanoNov 3, 2005
  4. Jon LoeligerNov 3, 2005
  5. Junio C HamanoNov 6, 2005
  6. Peter EriksenNov 3, 2005
  7. Junio C HamanoNov 3, 2005
  8. Daniel BarkalowNov 3, 2005
  9. Linus TorvaldsNov 3, 2005
  10. Junio C HamanoNov 3, 2005
  11. Peter EriksenNov 3, 2005
  12. Junio C HamanoNov 3, 2005
  13. Josef WeidendorferNov 3, 2005
  14. Daniel BarkalowNov 4, 2005
  15. Linus TorvaldsNov 3, 2005
  16. Junio C HamanoNov 3, 2005
  17. Junio C HamanoNov 3, 2005
  18. Josef WeidendorferNov 3, 2005
  19. Junio C HamanoNov 3, 2005
  20. Josef WeidendorferNov 3, 2005

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.