git alias for: rebasing, merging and cleaning
Add below alias to your .git/config file
[alias]
ff = !sh -c 'CURRENT_BRANCH=\`git rev-parse --abbrev-ref HEAD\` && git rebase $1 && git checkout $1 && git merge $CURRENT_BRANCH && git branch -D $CURRENT_BRANCH && git push origin :$CURRENT_BRANCH' -
now when you are working on feature branch and you would like to merge it with master branch you can do:
git ff master
This one command will do for you:
git rebase master
git checkout master
git merge <featurebranch>
git branch -D <featurebranch>
git push origin :<featurebranch>
Written by Roman Nowicki
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#