Git merge vs. rebase

By Mislav Marohnić on 20 Feb 2013 git pull --rebase instead of git pull git rebase -i @{u} before git push (on “feature”) git merge master to make feature compatible with latest master (on “master”) git merge --no-ff feature to ship a feature However if “feature” contains only 1 commit, avoid the merge commit: (on “master”) git cherry-pick feature If you enjoy this post, check out my git tips you didn’t know about ! git pull When you want to push your changes to a branch, but someone else already pushed before you, you have to pull in their changes first. Normally, git does a merge commit in that situation. Such merge commits can be numerous, especially between a team of people who push their changes often. Those merges convey no useful information to others, and litter the project’s history. You should always pull with git pull --rebase . Git can be configured to ...

Linked on 2014-11-07 23:38:40 | Similar Links