links:: Source Control for Test Automation with Git MOC
5.1 Resolving Conflicts
5.1 Resolving Conflicts
Example - Resolving Conflict While Merging.
Change the same file in local branch and remotely, then merge changes in local branch with resolving conflict
- create branch feature/test9-lisa
- update readme.md file
- update readme.md file in remote master
- fetch from remote master to local repo
- checkout feature/test9-lisa
- merge master to local
- resolve conflict (keep remote changes)
- commit merging master to local branch
git log --oneline git push origin git checkout -b feature/test9-lisa git commit -am "add test9-lisa-resolve-conflict" git fetch git checkout master git merge git checkout feature/test9-lisa git fetch git checkout master git merge git log --oneline git checkout feature/test9-lisa git merge master git status git add . git status git commit git log --oneline
Example - Resolving Conflict While Rebasing.
Change the same file in local branch and remotely, then rebase to remote master branch with resolving conflict
- create branch test10-lisa-resolve-conflict-renasing
- update readme.md file
- update readme.md file in remote master branch
- checkout master
- fetch from remote master to local repo
- merge master to local
- checkout test10-lisa-resolve-conflict-renasing
- rebase master
- resolve conflict (keep local changes)
- add changes
- rebase --continue
git checkout -b feature/test10-lisa git commit -am "add test10-lisa-resolve-conflict-renasing" git checkout master git fetch git status git merge git checkout feature/test10-lisa-resolve-conflict-renasing git rebase master git status git add . git rebase --continue git log --oneline