16

I have an app that is been tracked using git and the repository is hoted on github.

In my local computer the folders and files are these:

enter image description here

When I see the app in Github I see the folder TulpepWebSite duplicated.

enter image description here Why this could happen?

Ricardo Polo Jaramillo
  • 12,110
  • 13
  • 58
  • 83

2 Answers2

18

Git is case-sensitive, but Windows is not. So, the two directories aren't duplicates in Git's view.

If you renamed TulpepWebsite to TulpepWebSite sometime in the past, then all the files which were under TulpepWebsite would have been tracked by git under that old name, while any new files you added would be tracked under the new name.

To fix this, I'd just git-mv the folder to something else, commit, then git-mv it back to the old name and commit again. This will hopefully force all of the paths to use a consistent case.

nneonneo
  • 171,345
  • 36
  • 312
  • 383
  • Git should not detect that the folder with diferrent capital letters is deleted and delete it from the repository? – Ricardo Polo Jaramillo Aug 24 '12 at 17:31
  • The order of the commands: 1. git-mv 2. git-commit 3. git-push 4. git-mv 5. git-commit 6. git-push. Without the commit and push in-between moving... nothing happens. (Learned the hard way... d'oh). – MattBH Jan 21 '21 at 13:28
2

They arent duplicates: TulpepWebsite and TulpepWebSite (note the capital S).

You probably renamed the folder and git may have not removed the now non-existent folder... check this with git status, and then manually remove the folder from git by running git rm TulpepWebsite/

Kostia
  • 6,284
  • 1
  • 18
  • 15
  • Thanks, I had a similar problem this solved it. I ran `git rm -r` which remove the faulty folder but also from my disk. I only stage and committed the deletion of the faulty folder then after committing I ran `git reset --hard` to restore the non-committed but deleted file. – Desmond Chin Apr 07 '20 at 03:15