简体   繁体   English

如何使用另一个替换master分支-使用git和源代码树

[英]How to replace the master branch using another - with git and source tree

I often want to make the current branch the master branch, like described in this question . 我经常希望使当前分支成为master分支,如本问题所述 I use the approach that Jefromi answered. 我使用Jefromi回答的方法。

I wonder how I can do exactly this with source tree? 我不知道如何使用源代码树来做到这一点?

When your in the branch you want to copy the master branch to, run this command: 当您要将主分支复制到分支中时,运行以下命令:

git merge master

you can read about what it does here 您可以在这里了解它的功能

Well Jefromi's answer is perfect to keep the content in branch . Jefromi的答案非常适合将内容保留在分支中 But, I wonder why we try to make our current branch as master branch at any stage. 但是,我不知道为什么我们要在任何阶段都将当前分支设为主分支。 Best practice says, Well plan your project and never make direct changes in master. 最佳实践表明,精心计划您的项目,切勿直接更改母版。 Always, Master changes are merged into the branch and then branch is pushed to master . 通常,将更改合并到分支中 ,然后将分支推送到master

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

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