I need to be able to pull to a branch that I might not be on (in fact, assume for the sake of argument I don't know what branch I'm on). For example, I have a remote origin
with a branch master
that is tracked locally in the usual way by a local master
using a tracking branch. Are there options or arguments I can supply to git-pull
that will have the same effect as switching to master
, pulling, and then switching back to whatever branch I started on?
Many answers here suggest that this is not possible, but the documentation's discussion of <dst>
under <refspec>
suggests that something like
git pull origin master:master
will do the trick. Is that so?