git branch hierarchy issue

落爺英雄遲暮 提交于 2021-02-10 16:41:59

问题


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...

  • 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
    

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
  • 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
             ...
    

回答1:


2 standalone branches (see below) or is Develop under the Master?

Neither.

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.



来源:https://stackoverflow.com/questions/23466882/git-branch-hierarchy-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!