How do I rename a branch ‘a’ to ‘master’ and rename ‘master’ to ‘b’ in gerrit?
I have recently switched to gerrit from a shared git repository.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can create the “b” branch from master using the web UI: “Admin” -> “Projects” -> “YourProject” -> “Branches”. Enter “b” for “Branch Name”, and “master” as “Initial Revision”, then click the “Create Branch” button.
Now to replace what
masteris referencing, you have to have “force push” permission on the project, then do:This will replace the entire history of the “master” branch with that of the local “a” branch. So be very careful with this, and be sure that’s what you want to do.
Finally if you want to remove the ‘a’ branch in Gerrit, once again go to the web UI’s project management screen (same as above), tick the box next to the “a” branch, then click the “Delete” button.