Reputation: 5624
Is there a way to say this more concisely?
git checkout master
git merge branch
What I actually want to do much of the time is:
git rebase master branch
git checkout master
git merge branch
Answer https://stackoverflow.com/a/12343727/313842 sort of touched on this but leaves branch checkout out. git merge in one command is also a similar but different question.
Upvotes: 11
Views: 15475
Reputation: 962
If your branch names are generally long, and you constantly merge the branch you just checkout from, you can use:
checking out from branch you want to merge
git checkout branch
git merge -
the '-' is shorthand for the previous branch, very handy for quick checking out and merging
Upvotes: 24
Reputation: 141956
You have several options:
git alias
.gitconfig
fileUse & operator
git checkout master && git merge branch & ... & ...
Upvotes: 4