Reputation: 334
I find myself doing this repeatedly.
I'm in branch dev
.
git checkout master
git pull upstream master
git checkout dev
git rebase master
Is there a way I can do a pull as if I were in master
, without having to leave dev
?
Upvotes: 0
Views: 53
Reputation: 17455
... so
git checkout dev
git fetch upstream
git merge upstream/master
Alternatively, as @Makoto suggests, if you want to keep your branch history "linear", you may replace git merge upstream/master
with git rebase upstream/master
. Also git rebase
has a nice -i
option which allows you to select which commits you wish to rebase and in which order
Upvotes: 1