git pull conflict problem

Problem
After modifying the file locally, I tried to use the git pull command to merge the remote branch with the local branch. An error occurred. As follows:
Insert picture description here
solution

1. git stash  # 将本地修改的内容暂存起来
2. git stash list  # 查看保存的信息
3. git pull   # 将远程库中的文件内容pull到本地
4. git stash pop stash@{
    
    0} # 还原本地的修改,远程库中修改的内容和本地的内容如果发生冲突,将会出现5中的字符串。
5. 手动修改存在冲突的文件
 <<<<<<< Updatedupstream 
   xxx # pull下来的内容(远程库中的内容)
 =======
   xxx # 本地修改的内容
 >>>>>>> stashed changes

Guess you like

Origin blog.csdn.net/weixin_40315481/article/details/105445630