I try to push my changes to a remote repo, but I keep getting the following error:
My git command:
git push --set-upstream origin MyNotYetExistingOnline/Branch
The output:
Enumerating objects: 33, done.
Counting objects: 100% (33/33), done.
Delta compression using up to 20 threads
Compressing objects: 100% (29/29), done.
Writing objects: 100% (29/29), 7.01 KiB | 2.34 MiB/s, done.
Total 29 (delta 20), reused 0 (delta 0), pack-reused 0 (from 0)
error: remote unpack failed: error The tree object 85215f8e6fd75c064be11175c96a98f352317750 was rejected: The file 'clsSqlServerAccess.cs' and the file 'clsSQLServerAccess.cs' pushed differ in case. You must remove or rename one of them or disable case-enforcement (see https://aka.ms/git-platform-compat).
To https://dev.azure.com/AzureDevOpsRepo
! [remote rejected] MyNotYetExistingOnline/Branch -> MyNotYetExistingOnline/Branch (The tree object 85215f8e6fd75c064be11175c96a98f352317750 was rejected: The file 'clsSqlServerAccess.cs' and the file 'clsSQLServerAccess.cs' pushed differ in case. You must remove or rename one of them or disable case-enforcement (see https://aka.ms/git-platform-compat).) error: failed to push some refs to 'https://dev.azure.com/AzureDevOpsRepo'
I already name one of the files to clsSqlServerClass.cs and commited! I still get this error.
Why is that? How can I get rid of this error?
git show 85215f8e6fd75c. My crystal ball says that you have both filesclsSqlS...andclsSQLS...in the tree object. Remove one of them.git rm clsSQLServerAccess.cs? Or should I put the tree object hash behind thegit rm-command?git rm --cached clsSQLServerAccess.csshould do it. Then follow up withgit statusto see what happened.fatal: pathspec 'clsSQLServerAccess.cs' did not match any files. I copied the file name out of the object tree...git rmdoesn't affect the tree object directly, but the staged file. You must supply the path where the file is located:git rm --cached path/to/clsSQLServerAccess.cs.