0

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".

4
  • git is case sensitive, check If there is a mismatch in the case, such as "Src" vs. "src", this can cause issues on case-insensitive file systems. Try cloning the repository fresh in a different location and check if the "Src" folder appears. You might have a git configuration issue where certain files are ignored. Check if there are any path-specific settings in your .git/config or global ~/.gitconfig files. If the folder does not appear locally, you can still remove it from the repo with the following Git command: git rm -r --cached Src
    – Arko
    Commented Jan 10 at 8:34
  • I cloned the fresh repo and can see the "Src" folder only instead of the "src" folder but not both "Src" and "src" locally. but can see both "Src" and "src" on the azure repo. on the Azure repo, I want to keep the "src" folder and delete 'Src". Is it possible that earlier the folder was renamed? and then not remove and commit either folder to the Azure repo so that the old one "Src" remained there and then renamed the "src" folder is also there.
    – krunal
    Commented Jan 10 at 10:11
  • Since you can see both 'Src' and 'src' in Azure but only 'Src' locally, it suggests a case sensitivity issue. So you can see Src on azure repo right? If you don't need Src then remove it from portal itself. After removing 'Src' from Azure Repos, clone the repository anew on your local machine. This will ensure you have the latest version of the repository with only the 'src' folder. Check it once and let me know
    – Arko
    Commented Jan 10 at 10:14
  • Post your local folder structure and what stack/language it is? So, we may also try doing the same activity to observe Commented Jan 10 at 15:30

1 Answer 1

0

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:

Not the answer you're looking for? Browse other questions tagged or ask your own question.