How to ‘git pull’ into a branch that is not the current one?

Straightforward: Updating from a remote branch into a currently not checked-out branch master:

git fetch origin master:master

where origin is your remote and you are currently checked out in some branch e.g. dev.

If you want to update your current branch in addition to the specified branch at one go:

git pull origin master:master

Leave a Comment