怎么在Git上改变分支名,即使已经提出合并请求?

huangapple go评论51阅读模式
英文:

How to change a brach name on git even after raising a merge request?

问题

分支名称中包含有点号(.)。因此想要重命名该分支。

是否有命令可以执行此操作,还是需要创建一个新分支,再次将所有代码推送到新分支,并重新发起PR?

英文:

The brach name has a . in it. So want to rename the branch.

Any commands to do it or do I need to create a new branch and again push all the code there and raise PR again?

答案1

得分: 2

在我看来,创建一个新分支会是最好的。

创建一个没有“.”的新分支。
从旧分支拉取最新的更改到新分支(你所有的更改都会同步到新分支),然后使用新分支提出 PR,之后你可以删除旧分支。

英文:

In my opinion, creating a new branch would be best.

Create a new branch without the '.'
Take a pull from that old branch into the new one (all your changes will be synced into your new branch), now raise the PR with that new branch and you can delete the old one.

huangapple
  • 本文由 发表于 2023年3月1日 14:41:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75600304.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定