How do I add a deleted file to the index to be committed?
I have recently moved a project from SVN to git, and my colleague only just recently deleted all of the old .svn directories. I attempted to use git pull --rebase
in order to have his changes (which were numerous) be added before my own changes. There was a conflict, and I was able to use git add -A
to remove the vast majority of issues. However, there remains the following:
Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use开发者_Python百科 "git add/rm <file>..." as appropriate to mark resolution)
#
# both deleted: th/protected/modules/rights/views/authItem/.svn/text-base/_childForm.php.svn-base
If we've both deleted it, how am I supposed to use git add/rm
to add the change to the index?
In short, how does one go about adding a deleted file to the index to be committed?
EDIT:
I have tried to use git rm <filename>
on the file, but it does not work it provides the following message:
fatal: pathspec 'th/protected/modules/rights/views/authItem/.svn/text-base/_childForm.php.svn-base' did not match any files
EDIT:
Would it be worthwhile to make a dummy file of the same name that I can add to the index? I don't know what might happen, though, so I am unwilling to do this without a little bit of advice.
Try doing git rm --cached th/protected/modules/rights/views/authItem/.svn/text-base/_childForm.php.svn-base
to remove the file only from the index, not from the working tree.
Reference: http://www.kernel.org/pub/software/scm/git/docs/git-rm.html
You have a merge conflict. Try git mergetool
or
git add th/protected/modules/rights/views/authItem/.svn/text-base/_childForm.php.svn-base
精彩评论