How to create the branch from specific commit in different branch

前端 未结 5 532
旧时难觅i
旧时难觅i 2021-01-29 22:14

I have made several commits in the master branch and then merged them to dev branch.

I want to create a branch from a specific commit in dev branch, which was first comm

5条回答
  •  不要未来只要你来
    2021-01-29 22:41

    You have the arguments in the wrong order:

    git branch  
    

    and for that, it doesn't matter what branch is checked out; it'll do what you say. (If you omit the commit argument, it defaults to creating a branch at the same place as the current one.)

    If you want to check out the new branch as you create it:

    git checkout -b  
    

    with the same behavior if you omit the commit argument.

提交回复
热议问题