可以使用git-flow重命名功能分支吗?
我试着查找git flow help和git flow feature help,还有git-flow cheatsheet,但是什么都找不到。
或者,只使用git branch -m feature/new_name安全吗?
发布于 2015-04-21 10:18:14
是啊。
您可以这样做,但如果您推送了您的分支,并且有人正在使用它,您将需要更新他们有关更改的信息。
gitflow分支与任何其他分支没有什么不同。
Rename local branch
Git初学者(正常方式)
#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
(不推荐--也就是不要在家里尝试!)
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 :-)发布于 2015-11-10 19:49:41
可以,但如果您使用gitflow,您还需要手动修改.git/config文件(我不知道是否有自动方法),并为您想要重命名的特性重命名git-flow特性名称
发布于 2020-04-20 05:55:21
可以使用git-flow feature rename NewFeatureName重命名要素。
这似乎没有很好的记录。您可以找到参考here
https://stackoverflow.com/questions/29760651
复制相似问题