Git:与Git合并问题

Paw*_*wan 21 git github git-pull git-commit

我在用 git version 1.7.11.msysgit.0

我在GitHUB下创建了一个存储库,并添加了一个名为README.md的文件,其中包含一些文本内容.

后来,我安装了GIT Client,做了一个克隆,将服务器内容送到我的机器上.

然后我将文件README.md删除到我的本地机器上.

现在,当我执行git commit时,我收到此错误

praveenk@MSIN-BT-100 /d/workspace/MYTestRepo (master|MERGING)
$ git commit ;
U       README.md
error: 'commit' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: Exiting because of an unresolved conflict.
Run Code Online (Sandbox Code Playgroud)

这是git pull:

$ git pull;
U       README.md
A       One.txt
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
Run Code Online (Sandbox Code Playgroud)

如何解决这些错误?

wad*_*rld 30

做这个:

git merge --abort
git pull (to be sure you're up-to-date)
Run Code Online (Sandbox Code Playgroud)

现在用您想要的内容替换README.md文件的内容.如果您根本不想要它,请执行git rm README.md

然后,如果您替换了内容,请提交并推送这些内容:

git add README.md
git commit -m "comment"
git push
Run Code Online (Sandbox Code Playgroud)


dor*_*ien 9

尝试:

 git reset README.md
Run Code Online (Sandbox Code Playgroud)

我有一个类似的问题,这是解决它的唯一问题.