When you pull changes from the Git server you might get conflict in your code.
sudo git fetch origin
sudo git merge origin/master
So we will see how to resolve those conflicts. You can use git mergetool to check the conflicts. This is the merge conflict resolution tools to resolve merge conflicts.
git mergetool
- git checkout --ours <your File name>
- git checkout --theirs <your File name>
- git add <your File name>
- git commit -m "Conflicts Resolve"
(here remote is origin, local is master)
Note Difference between pull and fetch
n the simplest terms,
git pull
does a git fetch
followed by a git merge
.
No comments:
Post a Comment