Last Updated: February 25, 2016
·
1.293K
· gonzih

Git always rebase on git pull

git config --global branch.autosetuprebase always

2 Responses
Add your response

It's also good to set up git config --global git-up.rebase.arguments --preserve-merges. Please read my comment.

over 1 year ago ·

Thanks for advice @sheerun, but I think that provided scenarion:

You check out master branch
You do your feature on feature branch while origin/master also changes on remote side
You merge your feature branch to your local master, without calling git-up before 
You run git-up what results in rebasing master on origin/master and you loose your merge history: 

is just really bad habbit. You need to rebase your feature branch on top of origin/master first, and after that merge it in to the local master branch. It's just obvious for me.

over 1 year ago ·