Skip to content

Git 案例(持续更新) #157

@coconilu

Description

@coconilu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions