A similar question has already been asked here, but I think it got misunderstood (or maybe I misunderstood the question). So let me ask it clearly here. When I do git status
, I get (among other stuff) a line telling me whether or not I am behind of (or forked from) the remote branch I'm tracking. This is great. However, I have more than one remote. I have an 'official' remote (origin), which is shared (and I push there only when stuff is 'ready'), and a 'personal' remote (work), which I use to push stuff from home/work, so that I can keep work when I switch computer. Now, when I do git status
, the local branch is compared to origin/branch_name
(or whatever remote branch I'm tracking). However, I'd like to compare it also to other remotes/branches, but without pulling, simply comparing. Ideally, I'd like to do something like this:
git fetch work
git status work/branch_name
and get a status comparison of my local branch with work/branch_name.
Notice that I do not want to do a diff, that is, I am not interested in what files/paths are different. I just want to see if/when the two branches forked or if one is ahead of the other.
Also notice that I can get this information graphically with gitk --all
, looking where the two branches stay in the tree, but I would like to do this from command line. Also, in case of multiple branches, the tree displayed with gitk --all
can be a mess.
Thanks