tags:

views:

138

answers:

2

Im starting to learn to use git, and I am having a situation that I dont understand (the repository was taken out of svn)

Im on a branch jacob@379 with everything committed:

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

Try to do a merge to the master:

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

Which is confusing because the 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 is going on?

+1  A: 

I think the problem is here:

warning: refname 'jacob@379' is ambiguous.

try HEAD instead of jacob@379

But still, probably gotta get an unambiguous branch name. I think the @ has a special meaning. Or maybe you have a tag or other ref with the same name?

Also, it's great to pop open a graphical program that shows you all the tags and branches and all that with lines. If you've got it, try: gitk --all

JasonWoof
If you don't have a graphical history viewer, this will do in a pinch:git log --graph --decorate --all --pretty=short
JasonWoof
The '@' character has special meaning only in specific situations, namely in `xxx@{sth}`. See git-check-ref-format manpage to see which characters and sequences of characters are forbidden in branch names.
Jakub Narębski
+1  A: 

It's possible that there's nothing new to merge but the your branch has changes not in master. Such differences would also be reflected in commits so a simple check you can do is to check the logs:

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

# See what's in master but not my branch
git log [email protected]

I'm guessing you'll see some commits there. Imagine it this way:

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

In this case there's nothing new to merge into jacob@379 but the two branches are still quite clearly different.

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

Pat Notz