[英]How do I create a branch without commit history, that links back to where it branched from?
I'm using this guide: http://nvie.com/posts/a-successful-git-branching-model/ , as my way to use git with releases. 我正在使用本指南: http : //nvie.com/posts/a-successful-git-branching-model/ ,作为我在发行版中使用git的方式。 It advises you to use a develop
and a master
branch, and for each commit to master
to be a production ready release. 它建议您使用develop
和master
分支,并且每次提交master
都可以作为生产就绪版本。
I've finished version 0.1.0
of my project on my develop
branch, and tried branching off of that commit with: 我已经在我的develop
分支上完成了项目的0.1.0
版本,并尝试使用以下命令从该提交分支出来:
git checkout --orphan master
whilst on the develop
branch. 而在develop
分支。 This worked, and created a new master branch, without prior commit history. 这可以正常工作,并创建了一个新的master分支,没有以前的提交历史记录。 But , the problem is that this new commit on master
isn't linked to the develop
commit it branched from, as visible in my repo's network pane on github. 但是 ,问题在于, master
上的这个新提交未链接到其分支的develop
提交,这在github上我的仓库的网络窗格中可见。 But both branches do seem to be linked in the guide I linked to above. 但是两个分支似乎确实都在我上面链接的指南中链接了。
Is it possible to branch from a commit, and keep the connection between branches but not the commit history? 是否可以从提交分支,并保持分支之间的连接但不保留提交历史记录? So that I have a single commit to master
, that still links to where it branched from? 这样我就可以对master
进行一次提交,但仍可以链接到它从何处分支? Or is that impossible? 还是那不可能?
That's not possible. 那不可能 It doesn't really make sense for a branch to show the point it branched from without showing any history. 分支在不显示任何历史记录的情况下显示其分支点并没有任何意义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.