0

我从 file1-->file2 重命名了一个文件, git status 显示:

# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    pathname/file1.xml

我做了一个 git rm "pathname/file.xml" 并准备提交:

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   deleted:    pathname/file.xml

如何删除此文件?

在我提交和变基之后,我得到了

# Unmerged paths:

 #   (use "git reset HEAD <file>..." to unstage)
 #   (use "git add <file>..." to mark resolution)


added by us:        path/file1.xml
 no changes added to commit (use "git add" and/or "git commit -a")
4

2 回答 2

1

您已经分阶段进行了删除,现在使用git commit.

于 2013-08-23T19:27:06.837 回答
0

简短回答:用于git commit提交更改。

更长的答案:看起来您已经提交了新文件。如果你想让 git 看到文件移动了,最好修改你之前的提交。假设您在提交新文件后没有进行任何其他提交,您可以使用以下命令来执行此操作:

git commit --amend -C HEAD
于 2013-08-23T19:30:00.730 回答