I'm having a git repo setup in my main users directory in order to sync configuration among my computers like so:
/Users/myusername/.versionedConfigFile
/Users/myusername/myOtherFolders <-- to be igored
/Users/myusername/projects/somerepo/.git <-- to be igored
Besides these configuration file I want everything else to be ignored in my git repo, which is why my .gitignore looks like this:
*
!.gitignore
!.versionedConfigFile
While .gitignore allows me to exclude all my other files from tracking, I can still see that I'm in a git repository when I cd into "myOtherFolders" for example and running git commands like "git status". I would prefer to see "not a git repository" here to not get confused when working with other git repos in my directory tree (which still works of course).
Is there a way to "truly" exclude the folders from the .git repository?
Another option would be to:
.versionedConfigFile
/Users/myusername/.versionedConfigFile
to that separate repository.That way, you don't have to ignore everything, and you can have other repositories in /Users/myusername/
.