git分支层次结构问题 [英] git branch hierarchy issue

查看:101
本文介绍了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.

      这篇关于git分支层次结构问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆