1

I have this project which I've pushing it to github for the last couple month.

And I've noticed that one of my folders name changed it's name... I mean basically it didn't change much but bit more like changed from components to Components, and that really giving me hard-time deploying it cloud.

So here in VSCode the foler name is component.

enter image description here

Then committed it and pushed it to github and it beccame Components with first name become capital-letter

enter image description here

So, what caused that and how to solve? thanks in advane.

Lafoune
  • 436
  • 2
  • 12
  • 28
  • See https://stackoverflow.com/q/17683458/1256452 and https://stackoverflow.com/q/53057379/1256452 (and, related, https://stackoverflow.com/q/41154015/1256452) – torek Oct 31 '19 at 16:24

2 Answers2

3

You've probably renamed the folder locally, and Git is unaware of the changes because it's configured to ignorecase. You can set core.ignorecase to be true:

git config --global core.ignorecase true

and you can force Git to accept the changes:

git mv components tmp && git mv tmp Components
Maroun
  • 94,125
  • 30
  • 188
  • 241
  • `git mv components tmp && git mv tmp Components` is ginving `fatal: bad source, source=components, destination=tmp` – Lafoune Oct 31 '19 at 13:43
  • @Lafoune Maybe it's "Components" as the first argument instead, not sure why you're getting this. – Maroun Oct 31 '19 at 14:11
  • `core.ignorecase` is set locally in every repository: when Git creates a repository, it tests how the system behaves, and then sets `core.ignorecase` locally to `true` if the underlying file system treats file names as "the same" even if they differ in case. This means that setting it globally (`git config --global`) has no effect: the local setting continues to override the global one. In general it's not wise to override Git's computed settings: they tell Git what your computer does, and if you have them lie to Git, Git may mistakenly do things that you wouldn't want. – torek Oct 31 '19 at 16:00
1

You won't have to switch back to command-line for this git mv, considering VSCode 1.52 (Nov. 2020) now have:

Git: Rename

There's a new Git: Rename command which lets you perform a git mv command from the VS Code UI.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250