Marco
Marco

Reputation: 5109

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 scripts.

Upvotes: 9

Views: 4941

Answers (1)

shelhamer
shelhamer

Reputation: 31160

git rm --cached /src/Website/Scripts/common.js
git commit

--cached makes git refer to the versioned state, rather than the working tree.

Upvotes: 13

Related Questions