Automatic merge failed when using Git; fix conflicts and then commit the result. Solution

When using Git, Automatic merge failed; fix conflicts and then commit the result. Solution
Cause
First of all, the reason for this problem is because when you git pull, it will be divided into two steps. The first step is to pull down the code from the remote server. The second step is to merge, but when the merge fails, the above problems will occur.

Solution:
1. Discard the local commit and force back to the latest online version
git fetch --all
git reset --hard origin/the branch you need to pull down (default master)
git fetch
2. Save the local commit
git reset --merge
git commit -am 'commit information'
git pull

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324142330&siteId=291194637