重命名 git 裸存储库中的分支

Rename branches in git bare repository

是否可以在 packed-refs 文件中重命名裸存储库中的分支?

我想将其重命名为:

# pack-refs with: peeled fully-peeled 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/master
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/new

至:

# pack-refs with: peeled fully-peeled 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa refs/heads/old
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb refs/heads/master

正如托雷克所说:

You can rename branches by issuing the command

用法:

git branch -m <oldbranch> <newbranch>

来源:https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging