克隆特定的提交位桶 [英] clone specific commit bitbucket

查看:58
本文介绍了克隆特定的提交位桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

_

我在bitbucket中有一个项目,我想从中克隆特定的提交
这些是提交,我想要没有最后两个提交

I have an project in bitbucket and I want to clone specific commit from it
these are the commits, I want without the last two of them

但是在SourceTree中,我看不到提交号b6981f91fb876a
仅最后一个数字da84f64

butin SourceTree I can't see the commits number b6981f9 and 1fb876a
just the last number da84f64

我认为由于最后三个因素在一起,我该怎么办?

I think because the last 3 pushed together, what I should do?

推荐答案

是的,我想要除了最后2次提交之外的整个存储库,我不需要它,那么我如何指定该克隆?

yes I want the whole repository except the last 2 commits, I don't need it, so how I can specific that cloning?

通常的方法是:

  • 克隆所有内容
  • 签出一个新分支(或重置当前分支)到HEAD~2

git checkout -b newBranch @~2

除此之外:

  • shallow clone allows you to get the last n commits (which is not what you want)
  • sparse checkout is about subfolders (not sub-commits)
  • fetch single commit would not get all commits but some.

我在项目中有合作伙伴,但最近2次提交中存在错误

I have partners in project but we got bug in the last 2 commits

因此,使用SourceTree:

So, with SourceTree:

  • 克隆存储库(普通克隆)
  • 选择您要使用的提交:双击提交以将其检出,然后单击分支".

创建新分支后,进行工作并添加新的提交,然后推送错误修正分支.

Once you have created an new branch, work and add new commits, then push your bugfix branch.

这篇关于克隆特定的提交位桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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