In a repo I have multiple branches, among them "master" and "develop", which are set up to track remote branches "origin/master" and "origin/develop".
Is it possible to specify that I want both master and develop to be merged(fast-forwarded) at once?
When I do git pull
now I get something like this:
remote: Counting objects: 92, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 70 (delta 29), reused 28 (delta 8)
Unpacking objects: 100% (70/70), done.
From scm.my-site.com:my-repo
5386563..902fb45 develop -> origin/develop
d637d67..ba81fb2 master -> origin/master
Updating 5386563..902fb45
Fast-forward
all the remote branches are fetched, but only the branch I'm currently on is merged with its corresponding remote branch.
So I have to do git checkout master
...
Switched to branch 'master'
Your branch is behind 'origin/master' by 106 commits, and can be fast-forwarded.
...and then git pull
again, and then switch back to develop, to get the desired result.
I know I can make aliases/scripts that does these steps. But I want to avoid that if possible, as it is error prone and not very efficient.
Edit: ok let me rephrase that. My goal was not to discourage or frown upon script/alias customizing of git. I would just prefer a builtin solution if it exists :)
git pull origin refs/heads/develop:refs/remotes/origin/develop refs/heads/master:refs/remotes/origin/master
but that caused the remote master to be merged into develop..pull
into afetch
followed by amerge
into each branch.