Resolve warning "the following paths have collided" during clone in Bitbucket Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
This article covers resolving the collision path warning message when cloning in Bitbucket Cloud.
What does the collided paths warning mean
The user encountered the following error when performing a clone:
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'MMM'
'mmM'
'README.md'
'readme.md'This warning indicates conflicting file paths on a case-insensitive file system. This often occurs on file systems where the distinction between uppercase and lowercase letters in filenames is insignificant, such as on some versions of Windows or macOS.
Solution
To resolve this issue, follow the steps below.
Identify the Colliding Paths: The warning should provide information about the collided paths. Look at the warning message to identify which files or directories are causing the issue.
Rename or Remove Colliding Paths: Once you've identified the colliding paths, you must rename or remove one to resolve the conflict. Choose a consistent naming convention, either by renaming one of the colliding paths or by removing one of them.
This is necessary to work on this repository on a case-insensitive file system. If this solution is not acceptable to you, you will need to clone and work on this repo in a case-sensitive environment instead.
To rename the files:
If we look at the warning in the Summary above, we see that the files README.md and readme.md are colliding. Only one of these two files will be present in the clone directory.
After cloning the repository, change the current working directory to the clone directory, and check which of the two files is present: readme.md or README.MD.
Replace reponame in the first command with the name of your clone directory:
$ cd reponame $ lsLet's assume the ls command lists only the file readme.md and not the file README.md. You can rename the file readme.md to readme_old.md.
$ git mv readme.md readme_old.mdRestore the file README.md with the following command:
$ git restore README.mdCommit the changes and push to the remote.
$ git commit -m "renamed" $ git push origin master
Was this helpful?