[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Git help

From: Johannes Schindelin
Subject: Re: Git help
Date: Fri, 21 Sep 2007 15:12:57 +0100 (BST)


On Fri, 21 Sep 2007, Valentin Villenave wrote:

> 2007/9/21, Johannes Schindelin <address@hidden>:
> > This means that you have local changes.  Try "git status" and/or "git 
> > diff" to find out which changes those are.
> The point is: I do not have local changes: I haven't been working on the 
> code nor modifying anything...

Ah, my bad.

> maybe this error message is more self explanatory:
> %%%
> Auto-merging VERSION
> CONFLICT (content): Merge conflict in VERSION
> Automatic merge failed; fix conflicts and then commit the result
> %%%
> ...and the git-diff goes:
> %%%
> diff --cc VERSION
> index aa9f7e7,7242416..0000000
> --- a/VERSION
> +++ b/VERSION
> @@@ -1,6 -1,6 +1,11 @@@
> ++<<<<<<< HEAD/VERSION
> ++=======
> ++>>>>>>> 1982a5513e92f4f01605e9dbfdbb997f314b1cac/VERSION
> %%%
> I can't understand what's wrong this different versions thing. Every
> other branch gives me the message "already up to date".
> Can you enlighten me?

Yes, I think I can.

So this is part of the history:

B - ... - Y
   ... - T

where "B" is the branch point of _your_ branch ("Y") and _their_ branch 

Now, somewhere on both development lines, the same part of the file was 
touched.  One side (you, or at least somebody else working on that branch) 
changed the line to "VERSION=33".  The other side (Rune) has changed this 
line and/or the next line.  This is a conflicting change, since git has no 
way which version _you_ want.

Now, for you it is probably easy to tell, the part between "<<<" and "===" 
is what you had in your working tree, and the part between "===" and ">>>" 
is what comes from the branch you just pulled.

So you can resolve it by removing the part that you do not want to have, 
including the conflict markers "<<<", "===" and ">>>".

But I could also imagine that you did not want to pull at all... Probably 
you wanted to _switch_ to Rune's branch.  That would have been "git 
checkout -b dev/rune origin/dev/rune" (creating the new _local_ branch 
called "dev/rune").

If the latter is what you want, you can still do it, even in the middle of 
a conflicted merge, by using "git checkout -f" instead of "git checkout".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]