I run a git
server which contains only the bare remotes. Say, I have one bare remote called DIG.git
which I usually clone with:
git clone 55.66.77.88:git/DIG.git
and I want to rename the bare remote on the server from DIG.git
to DIGit
so that I can do
git clone 55.66.77.88:git/DIGit
Can I just log into the server and do
mv DIG.git DIGit
or is this considered bad practice? If so what is the right way to rename a bare remote?
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.
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.
Navigate to the settings tab. There, in the repository name section, type the new name you want to put and click Rename.
In order to change the URL of a Git remote, you have to use the “git remote set-url” command and specify the name of the remote as well as the new remote URL to be changed. For example, let's say that you want to change the URL of your Git origin remote.
You can rename the top folder of a git repo (bare or not) anyway you want.
It simply is the naming convention to have a .git extension to that folder when it is a bare repo, but this isn't mandatory.
Once you have renamed the repo on the server, you would have to change its origin url on the local clone that you did before:
cd /path/to/local/clone
git remote set-url origin 55.66.77.88:git/DIGit
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