git分支层次结构问题
我在Git上还算是个菜鸟,但是可能在阅读了几篇文章之后,我似乎对我的理解提出了疑问,我不确定我是否理解正确...
I am still pretty noob in Git but probably after reading articles after articles, I seem to have raise doubt in my understanding and I am not sure if I am understanding it right...
-
无论如何,我有2个分支,即Master和Develop(均使用git创建)分支)当我首先创建Master分支,然后是Develop时,我可以假设这2个分支是2个独立分支吗(请参阅下方)还是在大师"下开发?
Anyway I have 2 branches, Master and Develop (both created using git branch) As I created the Master branch first, followed by Develop, can I presume that this 2 branches are 2 standalone branches (see below) or is Develop under the Master?
Stand-Alone? Hierarchy?
Master -- | Master
Develop -- | \-- Develop
给我的印象是它应该是独立的,直到我运行 git show-branch
时,它将结果显示为(注意[Master]前面的空格):>
I was under the impression it should be standalone, until when I run git show-branch
, it is displaying the results as (Notice the space in front of the [Master]):
[Develop] Creation of new Branch
[Master] Build of new Project
- 如果要以Develop为基础创建新的(功能)分支,是否需要先将其设置为Develop分支,否则可以在任何分支中完成吗?
-
最后可以用以下格式查看终端中的分支:
- If I am to create new (feature) branches, using Develop as my base,do I need to set it to the Develop branch first, otherwise can it be done from any branches?
-
Lastly is it possible to view the branches in the terminal in the following format:
Master Develop newBranch01 ...
2个独立分支(请参阅下文),还是在Master之下进行开发?
2 standalone branches (see below) or is Develop under the Master?
都不是.
重要.分支名称没有.专注于提交.分支和标签名称是事后的,琐碎的便利. git log --graph --decorate --oneline --all
和 git show-branch
将以两种不同的表示形式显示历史,每种都有优点.
Commits matter. Branch names don't. Focus on the commits. Branch and tag names are an afterthought, a trivial convenience. git log --graph --decorate --oneline --all
and git show-branch
will show you the history in two different representations, each has advantages.