If you specify GIT_DIR=”.git2″ it will only specify this as relative to the current directory. And in this case it will not do the “search up until the first parent dir that contains a ‘.git2′” protocol as it does with the default ‘.git’.
Also if you specify a full path like /home/me/project/.git2 it will not add and commit files to a path in the repository relative to the location of the ‘.git2’.
So the question – is there a way to substitute the folder name git uses to some other name than ‘.git’ and have all other aspects of the protocol work exactly the same way as they do with the default ‘.git’ name ???
If you want to do this for a particular repository:
or:
If you want to change the default name of the Git directory everywhere, you can do something convoluted like this:
With the above, when you run
git fooit’ll search for.git2instead of.git. For the working directory, it’ll use the directory containing.git2.