Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git 案例(持续更新) #157

Open
coconilu opened this issue Apr 11, 2019 · 0 comments
Open

Git 案例(持续更新) #157

coconilu opened this issue Apr 11, 2019 · 0 comments

Comments

@coconilu
Copy link
Owner

coconilu commented Apr 11, 2019

1. 拉取合并代码时候报错

场景描述: 当面拉取远程分支并合并(git pull)的时候,如果遇到删除文件、重命名文件或者其它意外操作导致合并中断并报错:Git Pull Failed:You have not concluded your merge.Exiting because of unfinished merge

这里提供两种方案:

  1. 舍弃本地代码,远程版本覆盖本地版本
git fetch --all
git reset --hard {remote_name}/{branch_name}
git pull
  1. 保留本地代码,中止合并->重新合并->重新拉取,这种做法需要处理代码冲突
git merge --abort
git reset --merge
git pull
@coconilu coconilu changed the title Git 场景 Git 案例(持续更新) Mar 12, 2020
@coconilu coconilu mentioned this issue Jun 23, 2020
68 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant