简体   繁体   English

吉特:如何让实验分支负责人/主管?

[英]Git: How to make an experimental branch head/master?

Ok, I am pretty new to git, probably this was asked and answered already. 好的,我对git还是很陌生,可能已经有人问过并回答了。 Probably I messed up things... 可能我搞砸了...

Now, there once was a branch master. 现在,曾经有一个分支主管。 I committed some funky stuff that didn't work too well. 我犯了一些时髦的东西,效果不好。 Then I went back one revision, when everything was still well, and created an experimental branch and checked it out. 然后,当一切都还不错时,我回过头修订了版本,并创建了一个实验分支,并将其签出。 I started working on that branch and things went very well, no need for the funk in master's head. 我开始在那个分支上工作,一切进行得很顺利,不需要主人的放克。 So, now I am dozens of commits in the experimental branch and it is not experimental anymore. 因此,现在我在实验分支中有数十个提交,现在不再是实验性的。 So I checked out master, and went to the branching revision (one before head) and successfully merged with experimental. 因此,我签出了master,然后转到分支修订版(前一个版本)并成功地与实验合并。 Now git branch gives me 现在git branch给我

* (no branch)
  experimental
  master

How can I make it master and master's head? 如何使它成为主人和主人的头?

From the detached HEAD , you could delete the master branch and create a new branch named master . 从分离的HEAD ,您可以删除master分支并创建一个名为master的新分支。

git branch -d master
git branch master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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