I have a sub-directory in my repo that stopped tracking changes. I can add abc.php file to any directory above a certain level and git status
returns the expected results, but once I add abc.php to the subdirectory in question (or change an existing file), git status
comes up empty. I believe the subdirectory used to have it's own git repo, but I could be wrong.
I see that git update-index --really-refresh
may be an option , but I'm concerned because I added other git projects to "sibling" directories to the one having an issue. (I didn't do anything within my parent repo to acknowledge these, so hope that's okay too.)
That is, I have
Every parent directory in dir and above has no issues and works as expected.
My primary question: should I be concerned about running this given the above structure? I'd also like to ask if there's anything I should do with the repos within the primary repo (ie somehow declare them as submodules)?
Thanks.
Okay well I needed to run the following two commands to get it working:
git rm --cached path_to_subdir (no trailing slash)
git add path_to_subdir/*
Based on the messaging I was seeing when trying to run the command in my original post ( git update-index --really-refresh
), there used to be a git repo in the sub-directory that was not removed properly , and was never declared as a sub-module.
2 possibilities:
.gitignore
file in any parent directory)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.