How to rename git root folder?

Mick O'Hea picture Mick O'Hea · Aug 26, 2011 · Viewed 40.3k times · Source

I've just started using git in Vista, with my repository under /path/to/project/git repo.

I've now found that the space in the folder name is a minor irritation when working in git bash.

Can I just rename the folder to /path/to/project/gitrepo? Is everything within the git config relative, or is there anything that explicitly refers to the parent folder?

I've tried just taking a windows copy of the main folder, and run git bash on that, and 'git log' shows the changes I had previously made. So I assume renaming the main folder is OK, but I'd like to be sure before I go any further.

Answer

Greg Hewgill picture Greg Hewgill · Aug 26, 2011

Yes, it is safe to rename the folder containing a Git repository. All paths inside the Git repository are relative.