如何从旧提交创建新的Git分支? [英] How do I create a new Git branch from an old commit?
本文介绍了如何从旧提交创建新的Git分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复/最近/不太明确的问题
从先前提交使用Git分支
我有一个名为 jzbranch
的Git分支,并且有一个旧的提交ID: a9c146a09505837ec03b
。
如何从上面列出的信息创建一个新分支 justin
?
解决方案
git checkout -b justin a9c146a09505837ec03b
这将创建新分支并检出它。
git分支justin a9c146a09505837ec03b
这样可以创建分支而不需要检出。
Possible Duplicate / a more recent/less clear question
Branch from a previous commit using Git
I have a Git branch called jzbranch
and have an old commit id: a9c146a09505837ec03b
.
How do I create a new branch, justin
, from the information listed above?
解决方案
git checkout -b justin a9c146a09505837ec03b
This will create the new branch and check it out.
git branch justin a9c146a09505837ec03b
This creates the branch without checking it out.
这篇关于如何从旧提交创建新的Git分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文