重写 git 历史记录以将 master 分支转换为开发分支?
我希望重写我的 git 存储库以使用我遇到的新分支模型:
但现在我所有的历史都位于 master 分支中。我想重写它(可以使用 git-filter-branch 吗?)以便所有历史记录现在都在一个名为development 的分支中。
这可能吗?这绝对超出了我有限的 git 技能。
I'm looking to rewrite my git repo to use a new branching model I came across:
But right now all my history lives in the master branch. I'd like to rewrite it (possible using git-filter-branch?) So that all that history is in a branch called development now.
Is this possible? It's definitely beyond my limited git skills.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需要创建一个development分支,指向master的HEAD,然后就可以删除master分支了。
顺便提一句。从第一眼看这个分支模型,我不认为它是在真正考虑 git 的分支技术时创建的。因为它将分支解释为稳定的开发线,这对于 SVN 等其他 VCSystems 来说是正确的,但对于 git 则不然。 git 中的分支只是指向提交的指针,您可以根据需要随意移动它们。
Just create a development branch, pointing to the master's HEAD, and then you can delete the master branch.
Btw. from the first look at that branching model, I don't think it was made while really thinking of git's branching techniques. Because it interprets branches as steady development lines which is true for other VCSystems like SVN, but not for git. Branches in git are just pointers to commits, and you can move them around as much as you want.