If a file name exists that is at or close to the maximum length of 255 characters, source control operations will fail.
If you inspect the logs, you will see the following exception:
JGitInternalException: Exception caught during execution of reset command. File name too long
Steps to Reproduce
One easy way to get a long file name is to create a compound index with a lot of columns, as the generated name will contain each column on the index. The resulting file name will follow this general format:
The best workaround is to avoid creating compound indexes with more than a small amount of columns. This is a preventative measure. However, if the issue has already occurred, you will no longer be able to perform source control operations with the existing repository. The simplest solution in that case is to delete or reduce the complexity of the compound index, unlink your application from source control, and then re-link it to a brand new empty repository.
Related Problem: PRB1307874