我需要从过去的提交中创建另一个分支 [英] I need to create another branch from a past commit

查看:99
本文介绍了我需要从过去的提交中创建另一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Git仓库,看起来像这样:



我想从突出显示的提交中创建一个新分支。 (这是一个很长的故事,但基本上我想提交iOS应用程序,同时在最新的分支中计算出扭结)。我确信这是可能的,只是不知道如何实现它......此外,我没有看到在XCode 6.1中使用'标签'的任何方式。是否可用,只是没有记录? / p>

解决方案

您可以这样做(Check git-checkout(1)Manual Page 文档)

  git checkout -b | -B< new_branch> [< start point>] 




  • < ; start_point>




要开始提交的名称新的分支;有关详细信息,请参阅 git-branch(1) 。默认为 HEAD





  • <$ c

    lock

    创建一个新的分支名为< new_branch> ,并从< start_point> 开始。




    • -B



    创建分支< new_branch> ,并以< start_point> ;如果它已经存在,然后将它重置为< start_point>



    I have a Git repos that looks like this:

    I want to create a new branch from the highlighted commit. (It's a long story, but basically I want to submit the iOS app while working out kinks in the latest branch). I'm pretty sure this is possible, just don't know how to accomplish it... in addition, I don't see any way of using 'tags' in XCode 6.1.. is it available, just not documented?

    解决方案

    You can do as (Check git-checkout(1) Manual Page documentation)

    git checkout -b|-B <new_branch> [<start point>]
    

    • <start_point>:

    The name of a commit at which to start the new branch; see git-branch(1) for details. Defaults to HEAD.

    • -b <new_branch>:

    Create a new branch named <new_branch> and start it at <start_point>.

    • -B <new_branch>:

    Creates the branch <new_branch> and start it at <start_point>; if it already exists, then reset it to <start_point>.

    这篇关于我需要从过去的提交中创建另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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