简体   繁体   English

在gerrit中重命名远程分支

[英]Rename remote branch in gerrit

I have remote branch ABC , and I want to rename it to XYZ.我有远程分支ABC ,我想将其重命名为XYZ. I have renamed it locally.我在本地重命名了它。

My current branch is XYZ .我目前的分支是XYZ The command below will create XYZ on ABC branch下面的命令将在ABC分支上创建XYZ

git push origin XYZ:refs/for/ABC

How do I rename ABC to XYZ on the remote?如何在遥控器上将ABC重命名为XYZ

To rename a branch you need to create a new branch and then delete the old one, but to do that you need to have "Create Reference" permission on "refs/*" reference (probably you'll need help from Gerrit administrators).要重命名分支,您需要创建一个新分支,然后删除旧分支,但要做到这一点,您需要对“refs/*”引用具有“创建引用”权限(可能您需要 Gerrit 管理员的帮助)。

IF YOU HAVE PERMISSION, you can do that using the web UI or using the command line.如果您有权限,则可以使用 Web UI 或使用命令行来执行此操作。

Web UI网页界面

To create or delete branches you need to go to Projects > List > Select project > Branches要创建或删除分支,您需要转到项目 > 列表 > 选择项目 > 分支

Command line命令行

a) Create branch a) 创建分支

git push origin ABC:XYZ

b) Delete branch b) 删除分支

git push origin :ABC

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM