After using git pull
command, sometimes message below would pop up:
1 | error: Your local changes to '<filename>' would be overwritten by merge. Aborting. |
It means that the update is conflict with the local content, you should save your work before you merge them.
Save your local modification
Go to the working directory, and
1 | $ git stash |
You can use git stash list
to see what you have saved.
Pull
After that, you can pull.
1 | $ git pull |
Recover the saving
1 | $ git stash pop stash@{0} |
It would inform you that:
1 | Auto-merging <filename> |
The system automatically merge them, but you have to deal with the conflict manually.
Resolve the conflict
Open the conflicted file, you can see something like:
1 | <<<<<<< Updated upstream |
Decide which one you want to keep.