使用Git从之前的提交中分支出来 [英] Branch from a previous commit using Git
本文介绍了使用Git从之前的提交中分支出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有n个提交,我怎么能从n-3提交分支?
If I have n commits, how can I branch from the n-3 commit?
我可以看到每个提交的哈希。
I can see the hash of every commit.
推荐答案
您可以通过哈希创建分支:
You can create the branch via a hash:
git branch branchname <sha1-of-commit>
或者使用符号引用:
Or by using a symbolic reference:
git branch branchname HEAD~3
这篇关于使用Git从之前的提交中分支出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文