问题:
I have a repository in Git. 我在Git中有一个存储库。 I made a branch, then did some changes both to the master and to the branch. 我做了一个分支,然后对母版和分支进行了一些更改。
Then, tens of commits later, I realized the branch is in much better state than the master, so I want the branch to "become" the master and disregard the changes on master. 然后,在数十次提交之后,我意识到分支的状态要比主服务器好得多,因此我希望分支“成为”主服务器,而忽略主服务器上的更改。
I cannot merge it, because I don't want to keep the changes on master. 我无法合并它,因为我不想将更改保留在主文件上。 What should I do? 我该怎么办?
Extra : In this case, the 'old' master has already been push
-ed to another repository such as GitHub. 附加 :在这种情况下,“旧”母版已经push
送到另一个存储库,例如GitHub。 How does this change things? 这如何改变事情?
解决方案:
参考一: https://stackoom.com/question/Bamc/将当前的Git分支设为主分支参考二: https://oldbug.net/q/Bamc/Make-the-current-Git-branch-a-master-branch
来源:oschina
链接:https://my.oschina.net/stackoom/blog/3217379