Skip to content

Instantly share code, notes, and snippets.

@Jarvie8176
Last active April 27, 2016 21:01
Show Gist options
  • Save Jarvie8176/dc10513129a1712aba4f70ddc9160b5b to your computer and use it in GitHub Desktop.
Save Jarvie8176/dc10513129a1712aba4f70ddc9160b5b to your computer and use it in GitHub Desktop.
resolve merge conflicts in command line

squash commits in dev branch

git checkout -b origin/<dev-branch>
git rebase -i HEAD~<number-of-commits-in-dev-branch>
  • mark the first commit as "pick" and the others as "squash"
git push origin <dev-branch>
  • use --force if necessary

solve conflicts

git checkout <dev-branch>
git merge <base-branch>
  • then resolve conflicts using text editor
git add <resolved-file-dir>
  • add resovled files

git commit -m "message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment