John Pankowicz John Pankowicz - 9 months ago 39
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 https://github.com:johnpankowicz/govmeeting.git
cd govmeeting
git remote add upstream https://github.com/govmeeting/govmeeting.git
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 https://github.com/johnpankowicz/govmeeting.git (fetch)
origin https://github.com/johnpankowicz/govmeeting.git (push)
upstream https://github.com/govmeeting/govmeeting.git (fetch)
upstream https://github.com/govmeeting/govmeeting.git (push)


$ git remote show upstream

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


$ git branch -r

origin/fix-webapp-startup
origin/master
origin/pass-ang-arg
origin/video
upstream/master


$ 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.