lord.garbage
lord.garbage

Reputation: 5970

Renaming a remote (bare) repository with git

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?

Upvotes: 8

Views: 2920

Answers (1)

VonC
VonC

Reputation: 1329682

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

Upvotes: 12

Related Questions