首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重命名git flow中的分支

重命名git flow中的分支
EN

Stack Overflow用户
提问于 2015-04-21 08:13:47
回答 3查看 19.7K关注 0票数 21

可以使用git-flow重命名功能分支吗?

我试着查找git flow helpgit flow feature help,还有git-flow cheatsheet,但是什么都找不到。

或者,只使用git branch -m feature/new_name安全吗?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-04-21 10:18:14

是啊。

您可以这样做,但如果您推送了您的分支,并且有人正在使用它,您将需要更新他们有关更改的信息。

gitflow分支与任何其他分支没有什么不同。

Rename local branch

Git初学者(正常方式)

代码语言:javascript
复制
#Checkout new branch and delete the old one
git checkout -b <new_name>
git branch -D <old_name>

#Use the short git branch move (-m flag)
git branch -m <old_name> <new_name>

#Use the long git branch move (–move flag)
git branch --move <old_name> <new_name>

Advanced: Manually rename branch

(不推荐--也就是不要在家里尝试!)

代码语言:javascript
复制
Rename the old branch under .git/refs/heads to the new name
Rename the old branch under .git/logs/refs/heads to the new name
Update the .git/HEAD to point to your new branch name.

Sit back and Enjoy GIT :-)
票数 43
EN

Stack Overflow用户

发布于 2015-11-10 19:49:41

可以,但如果您使用gitflow,您还需要手动修改.git/config文件(我不知道是否有自动方法),并为您想要重命名的特性重命名git-flow特性名称

票数 9
EN

Stack Overflow用户

发布于 2020-04-20 05:55:21

可以使用git-flow feature rename NewFeatureName重命名要素。

这似乎没有很好的记录。您可以找到参考here

票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29760651

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档