I\'m sorry if this is a duplicate, I\'ve searched google and SO and couldn\'t find anything similar since it\'s a fairly generic set of words to search for!
What I w
You can link to a gitdir in an arbitrary location by creating a file called .git in the root of the work tree, containing the following:
gitdir:
Naturally you need to have first moved the original .git directory to its exterior location.
All well-behaved git tools will honour this, without relying on environment variables, or OS-specific mechanisms such as symlinks. You should also be able to place these links at arbitrary locations in your directory hierarchy, thereby linking to multiple repositories.
Of course, such .git files will still be visible in the work tree, so this approach may not be acceptable in your case. However, if such a file gets deleted it is trivial to restore (unlike a .git directory).