Skip to content

Instantly share code, notes, and snippets.

@cecepm
Last active December 20, 2015 18:07
Show Gist options
  • Select an option

  • Save cecepm/12f398dd521e9c3a830e to your computer and use it in GitHub Desktop.

Select an option

Save cecepm/12f398dd521e9c3a830e to your computer and use it in GitHub Desktop.
Git Merge

Merge feature_branch to master

Pull update on master branch

git checkout master
git pull

Change back to feature_branch, pull and then rebase based on master branch, and resolve conflict (if any)

git checkout feature_branch
git pull
git rebase -i master

Merge feature_branch back to master

git checkout master
git merge --no-ff feature_branch

Check it

git log

Everything okay? then push to remote repo

git push origin master

Test merge using temporary branch

git checkout master
git pull
git checkout -b temp_branch
git merge --no-ff feature_branch

Check it

git log

After test complete, you can delete test_branch

git checkout master
git branch -D test_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment