问题描述:

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?

网友答案:

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
相关阅读:
Top