克隆特定的提交位桶

编程入门 行业动态 更新时间:2024-10-17 13:39:18
本文介绍了克隆特定的提交位桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

_

我在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中,我看不到提交号b6981f9和1fb876a 仅最后一个数字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

除此之外:

  • 浅克隆允许您获取最后n次提交(这不是您想要的)
  • 稀疏签出与子文件夹(而不是子提交)有关
  • 获取单个提交将不会得到所有提交,但会得到一些提交.
  • 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.

更多推荐

克隆特定的提交位桶

本文发布于:2023-07-17 02:48:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!