I have a directory in my project that is being ignored but it is not in any of the places that I would expect ignored folders to be (.gitignore, exclude or config).
it is an Android Studio project that I build with gradle, my VCS is Git. I'm using SourceTree & GitBash to manage the repo. I've reset all .ignore files in my project to be empty, \info\exclude is empty and config doesn't have 'excludesfile' property.
folder being ignored is - 'myProj/app/src/debug/res/raw/' have no idea how this folder got ignored in the first place. there is a different relative folder 'myProj/app/src/debug/res/values' that is tracked by git.
Is there any other place I didn't look that set ignore files? Is there any git command that can show where is this folder being set as ignored folder? maybe a binary I overlooked that I can just delete?
currently running 'git status --ignored' show only 'myProj/app/src/debug/res/raw/' as ignored.
Use git check-ignore -v myProj/app/src/debug/res/raw/
to see where the ignore is. You may have to give it the name of a file in that directory instead of the directory itself.
Thanks guys for responding so quick,
I've eventually resolved the issue by just adding the folder using:
then commit and push, this was suppose to be a meanwhile solution until real solution is found but did the trick, after doing that the folder started to be tracked.
Note that your rule may also exist in the .gitignore_global
file (in your user folder). You may have accidentally added it by choosing "Global ignore list" in the "Add this ignore entry to" dropdown in SourceTree.
You usually don't want to add a folder name to your global ignore list
I know this question is 5 years old but it's the first one on Google results.
Another possibility besides the ones mentioned before is that the folder has been added as a submodule. E.g. in GitHub, the bottom folder is a submodule:
This happened to me recently while copying a whole git project into another. That is, my repo looked like this:
repo
|
|__ .gitignore
|__ .git/ #git folder for repo
|__ some_files.ext
|
|__ ignored_folder
|__ .git/ #git folder of the copied repo
|__ .gitignore
|__ some_other_files.ext
My specific solution was to:
ignored_folder
outside of the repo..git
folder inside the moved ignored_folder
.ignored_folder
back in.However, I'm sure there are much better git-like solutions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With