简体   繁体   中英

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. It advises you to use a develop and a master branch, and for each commit to master to be a production ready release.

I've finished version 0.1.0 of my project on my develop branch, and tried branching off of that commit with:

git checkout --orphan master

whilst on the develop branch. This worked, and created a new master branch, without prior commit history. 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. 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? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM