从先前提交的master创建分支

时间:2019-04-16 09:51:16

标签: git

所以我们在仓库中有一个母版,我们想创建一个基于该分支中较早提交的分支。有人知道吗?

2 个答案:

答案 0 :(得分:1)

如果您看着git branch的男人,您将看到以下内容:

git branch [--track | --no-track] [-f] <branchname> [<start-point>]

并且:

       <start-point>
       The new branch head will point to this commit. It may be given as a branch name, a commit-id, or a tag. If this option is omitted, the current
       HEAD will be used instead.

答案 1 :(得分:0)

git branch branchname <sha1-of-commit>