John Pankowicz John Pankowicz - 1 year ago 94
Git Question

Cannot see upstream branches in git log or gitk

I forked a GitHub repo, cloned my fork locally and add the remote "upstream" to point to the original repo. It appears everything is set up correctly, but "git log" and gitk only show branches from origin (my fork) and not upstream.

I have another machine on which everything works fine. The setup appears the same on both machines. What am I missing?

My steps:

git clone
cd govmeeting
git remote add upstream
git branch --set-upstream master upstream/master
git fetch upstream

If I run "git log --oneline --decorate=short", I only see the origin branches. For example:

dd98b4a (origin/master, master) Minor fixes in register. Documentation and minor UI changes. (#35)

But on my other machine, where it works, I also see the upstream branches:

dd98b4a (upstream/master, origin/master, master) Minor fixes in register. Documentation and minor UI changes. (#35)

Everything appears to be set up the same on both machines. The output is identical for each of the following commands:

$ git remote -v

origin (fetch)
origin (push)
upstream (fetch)
upstream (push)

$ git remote show upstream

* remote upstream
Fetch URL:
Push URL:
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (local out of date)

$ git branch -r


$ git ls-remote upstream

867818be9d597ced7be5e8c1f40e033cb7f65b01 HEAD
867818be9d597ced7be5e8c1f40e033cb7f65b01 refs/heads/master
f4521d466eb98903abba4ccd92b81c2511462a1d refs/pull/15/head
6471492dfe3e253725e66265a30d8ef895d65630 refs/pull/22/head
... etc. ...

Answer Source

If upstream/master has been committed to, the relevant commit is no longer its HEAD, and won't be mentioned by git log. The other machine hasn't received the new commit yet.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download