Git merge confusion. The diff shows the differences, and the merge says they are not

I am starting to learn to use git, and I have a situation that I do not understand (the repository was pulled from svn)

Im on the jacob@379 branch with everything that was done:

 host$ git status # On branch jacob@379 nothing to commit (working directory clean) 

Try merging with the master:

 host:$ git merge master Already up-to-date. 

Which is confusing because diff says there are differences!

 host$ git diff master..jacob@379 warning: refname ' jacob@379 ' is ambiguous. diff --git a/.classpath b/.classpath index 8ba1225..5af1151 100644 --- a/.classpath +++ b/.classpath @@ -10,6 +10,11 @@ .... 

What's happening?

+1
source share
2 answers

It is possible that there is nothing new to merge, but your branch has no changes to the master. Such differences will also be reflected in the commit, so a simple check you can do is check the logs:

 # See what in my branch but not master git log master..jacob@379 # See what in master but not my branch git log jacob@379..master 

I assume you will see some commits. Imagine it like this:

  o --- o --- A --- B --- C master
          \ \
           ---- D --- E --- F jacob@379

In this case, there is nothing new to merge into jacob@379 , but the two branches are still completely different.

A quick look at gitk --all will probably be really useful here.

+3
source

I think the problem is here:

 warning: refname ' jacob@379 ' is ambiguous. 

try HEAD instead of jacob @ 379

But still, probably, you need to get an unambiguous name for the branch. I think @ is of particular importance. Or maybe you have a tag or other link with the same name?

In addition, it’s great to pop open a graphical program that will show you all the tags and branches and everything with lines. If you have this, try: gitk --all

+1
source

All Articles