2022-03-30

GIT Bash listing all branches as new on every pull

 Problem: 

Whenever I did a "git pull" or "git fetch", it would list all branches as new, it seemed. 

Reason:

The reason was that we had subfolders in the path to the repo thet were written with either capital or small letters. Windows is not case sensitive, but git is. The subfolder somehow had been fetched with capital letters, but the standard was to have small characters.

Solution:

While in the root folder of your project...

cd .git/refs/remotes/origin/feature

ls

See that there is a folder with the wrong casing.

Do a:

rm OFFENDING_FOLDER -R

Navigate back down to project root folder.

Make sure that the branch you are on is using the path the way you want it.

git pull

It will now create the removed folder with the correct casing.