[英]How to get all branches content on any new branch using GIT
I know this question is asked many times on SO. 我知道这个问题已经被问过很多次了。
I just wanted to get proper way of branching and fixing mine. 我只是想获得正确的分支和修复方式。
My working methodology on Git branching is: 我在Git分支上的工作方法是:
So, I know this is not the right way to doing this Git branching. 因此,我知道这不是执行此Git分支的正确方法。
I always stumbled myself on these branching and sometime I lost work too due to wrong branching and push pull. 我总是在这些分支上迷迷糊糊,有时我会因为错误的分支和推拉而失去工作。
Can anybody explain the write way of doing this branching properly? 谁能解释正确执行此分支的写入方式? Including best practices as well.
包括最佳做法。 So, I will follow those procedures for my current project.
因此,我将在当前项目中遵循这些步骤。
Also, my main concern is having latest code all the time on any branch ( I think master as we checkout new branch from that branch ) 另外,我主要关心的是始终在任何分支上都拥有最新代码(我认为是主人,因为我们从该分支签出新分支)
I'll try to explain one way to work with branches. 我将尝试解释使用分支的一种方法。 You can find other in the internet and from my point of view there is not a perfect one.
您可以在互联网上找到其他网站,但从我的角度来看,这并不是一个完美的网站。
In this image, you have your master
branch. 在此图像中,您拥有
master
分支。 The one that has the working code that is on production. 具有正在生产的工作代码的代码。
From Master branch, you have a develop
branch. 在Master分支中,您有一个
develop
分支。 This branch will have your most recent code, with features that your testing and building. 该分支将包含您的最新代码以及测试和构建的功能。
From Develop branch, you have all your feature
branches. 在Develop分支中,您拥有所有
feature
分支。 The ones that you'll start new features 您将启动的新功能
So, the workflow would be: "Oh, I have an idea off feature to add to this project." 因此,工作流程将是:“哦,我有个想法要添加到该项目中。”
develop
with the name of 'feature idea'
develop
创建分支,名称为'feature idea'
develop
to test develop
测试 develop
named 'ideia 2'
develop
创建另一个名为'ideia 2'
分支 develop
develop
master
master
This way you'll always have a working code at master
and a 'beta' version at develop
这样,你将永远有在工作代码
master
和“测试”版本的develop
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.