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.
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under the Repository Name heading, type the new name of your repository. Click Rename.
Change Default Directory in Git BashRight-click on Git Bash's shortcut icon and go to the Properties. In the Start in field, paste the path to the desired folder, e.g. D:\WorkDir.
The fastest way to change the folder name when cloning a GitHub repository is to simply specify the name you want at the end of the git clone command. Here's a short video showing the entire process: When you're done downloading the repo do cd your-app-name to enter your directory with all the Create React App files.
Select the repo you want to rename under Git repositories on the left and select .... Select Rename repository... from the menu. If the Repositories pane is not expanded, select > to expand it and display the list of repositories. Enter a new repo name in the Repository name field in the dialog, then select Rename.
Yes, it is safe to rename the folder containing a Git repository. All paths inside the Git repository are relative.
To amend slightly Greg's answer, yes, everything with a git repo is relative to the .git
parent directory, but:
(and this won't probably affect you directly, I only mention those reasons here for completeness' sake.):
GIT_INDEX_FILE
using within a filter-branch
command for instance, see this thread), so, obviously, don't rename the root directory while performing a complex operation on your repo.Plus, a "windows copy" (instead of a git clone
), will copy everything including hooks, which may include absolute path in their script if you have edited them and made those kind of modification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With