Azure repo showing specific folder but not displaying when cloned on local

77 Views Asked by At

I can see one specific folder("Src") on azure repo(that needs to remove) but now showing on local folder srtucture post clone it in the system. Actually that folder needs to remove from azure and with respect to that need to delete from local directory and create a PR so that post CI/CD that folder can be removed from azure repo.

Thanks,

tried to show all files and folder but could not find. also changed project reference from "Src" to "src" but it is showing "the reference is invalid or unsupported".

1

There are 1 best solutions below

0
Arko On

It seems like you are dealing with a case-sensitive naming conflict which is typical when transitioning between case-insensitive filesystems (like Windows) and case-sensitive ones (like those in Linux or macOS).

Git can be case-sensitive, and if your remote repository (in this case, Azure Repos) is on a case-sensitive filesystem, it can differentiate between Src and src. However, when you clone the repository to a case-insensitive filesystem (common in Windows), it can only see one of the folders.

Here's how to resolve the issue and remove the unwanted Src folder from the Azure repo: First, set your Git to be case sensitive on your local machine. This can help prevent these issues from occurring again in the future.

git config core.ignorecase false

enter image description here

Clone the repository again to ensure you have a fresh starting point.

git clone <repo-url>

enter image description here

If you're on a case-insensitive filesystem and you want to rename Src to src, you might need to use an intermediate name.

If the Src directory is empty, you need to remove it from Git and then commit that change. If you expect the Src directory to have files, make sure those files are not untracked. enter image description here

Rename After Adding Files. Once you have committed the files inside the Src directory, try the git mv command again.

git mv Src tempname
git mv tempname src
git commit -m "Rename Src to src"

enter image description here

If the Directory Exists on Remote But Not Locally i.e. If the Src directory exists on the remote repository but not locally, fetch the latest changes and check out the branch again.

git fetch
git checkout main

enter image description here Then retry listing the contents and if the Src directory exists with content, proceed with the rename. If Renaming Is Not Possible Locally Due to Filesystem Constraints, consider using the Azure Repos web interface to delete the Src directory directly in the browser.

Finally commit and push these changes to your remote repository.

References: