【问题标题】:Creating new Branch under master, showing already existing commit under newly created branch在 master 下创建新分支,在新创建的分支下显示已经存在的提交
【发布时间】:2017-09-07 17:33:09
【问题描述】:

当我在 bitbucket 上使用 create branch 选项创建新分支时,它创建成功。

但是当我继续提交选项并从标题COMMITS..下的下拉列表中选择新创建的分支时,它显示该新分支的提交很少。

新分支时如何提交。

请帮帮我。

【问题讨论】:

    标签: git github version-control bitbucket bitbucket-server


    【解决方案1】:

    显示的提交位于您从中创建新分支的分支上。假设您从master 创建newBranch,结构如下:

    A---B---C  master
             \
              D newBranch
    

    所以提交显示

    D
    C
    B
    A
    

    如果你想显示来自newBranch的提交,你可以在Branches选项卡中查看,选择分支并在Commits选项卡中查看提交。

    【讨论】:

    • 这对我有用。我正在从 COMMIT 选项中查看我新创建的分支。这就是为什么要在它下面提交。您的解决方案是解释性的。谢谢
    【解决方案2】:

    选择你想从(master)开始的分支,而不是像之前那样从这一点创建分支。

    另一种选择是使用命令行:

    # checkout master
    git checkout master
    
    # create new branch out of master
    git checkout -b <newB>
    
    # push the new branch to the remote
    git push origin newB
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-21
      • 1970-01-01
      • 2017-06-09
      • 2018-09-08
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 2019-06-28
      相关资源
      最近更新 更多