How to remove duplicate file tracking in Git
One of my files is tracked twice after I changed the name of my folder.
Git is now tracking the following two files, which are actually the same file.
src/Website/scripts/common.js
src/Website/Scripts/common.js
How can I remove the second one from be tracked? This folder doesn't excist anymore, because I renamed it from Scripts
to 开发者_如何学JAVAscripts
.
git rm --cached /src/Website/Scripts/common.js
git commit
--cached makes git refer to the versioned state, rather than the working tree.
精彩评论