How to remove unnamed branch in git shown in Github network view

微笑、不失礼 提交于 2020-01-02 08:04:45

问题


In the Github's network view of my git repository, there is a "phantom" branch that has no name. Please see the picture below.

For the sake of simplicity I would like to remove the black branch (leaving only the blue branch).

How can this be done?

Some of the labels with the hash:


回答1:


Assume the black branch starts at Commit A, and ends at Commit Z. Both A and Z are the blue dots. In the cmd, A and Z are the commit sha1.

git rebase --onto Z^2 A master

This makes a linear history. But if doing so, you must git push origin -f master:master to update the remote master by force and inform every member to fetch and track the new master and abandon the old one.



来源:https://stackoverflow.com/questions/38113359/how-to-remove-unnamed-branch-in-git-shown-in-github-network-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!