3

We can set initial topic name by: git push origin HEAD:refs/heads/master/topic_name But I wonder how could I change the topic name via command line later on? Thanks in advance.

Eric Liu
  • 31
  • 1
  • 4
  • Are you searching for renaming the branch name? (http://stackoverflow.com/questions/6591213/how-do-i-rename-the-local-branch) – wake-0 Jun 17 '16 at 07:47

2 Answers2

2

You can set the topic using REST

https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-topic

-1

Simply push your local branch under a different name:

git push <remote> <remote>/<old_name>:refs/heads/<new_name> :<old_name>

In your case:

git push origin HEAD:refs/heads/master/<new_name> :refs/heads/master/topic_name

Here, you push:

  • your local branch under a new remote name
  • "nothing" to the old branch (which is then deleted)
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Thanks. Is there any way just using gerrit command instead of using git push, consider you don't have repo cloned locally. – Eric Liu Jun 17 '16 at 11:14