How do I rename the .git directory?
Say for instance I have a repo that I have been working with for some time but now I decide to rename the .git directory. I tried the bash mv command but after I did that git status said the my working directory is not a git repository.
No idea why you would ever want to rename that, but anyway…
Git expects :
.gitdirectory to exist under the current directory, or one of its parents,GIT_DIRenvironment variable to be set.Generally, unless very special circumstances are in effect, you should never tread apart from
.git. It is this directory which contains everything (the same way Subversion 1.7+ uses a.svndirectory and CVS usesCVSdirectories — only that git only uses one directory at the root)The only exception to this are bare repositories, for which you need to be in the git directory itself — but you normally never touch these directly unless you really know what you are doing.