克隆 github 项目的一部分 [英] clone parts of a github project

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

问题描述

可能的重复:
有没有办法克隆一个git仅存储库的子目录?

我正在尝试克隆 github 项目的一部分,但我只能获取根文件夹.这是我第一次尝试使用 github 并且我刚刚安装了 tortoisegit,我曾经使用 svn 和 cvs,您可以在其中取出您想要结帐的文件夹,但似乎 git 在根文件夹中只有一个 .git 文件,所以我不知道该怎么办.

I'm trying to clone parts of a github project but I can only get the root folder. This is the first time im trying to use github and I just installed tortoisegit, im used to svn and cvs where you could just take a folder you wanted to checkout, but it seems git only got a .git file in the root folder so im not sure what to do.

推荐答案

有子树合并.

但这里有一个更简单但部分的解决方案,可能足以满足您的需求.只需分叉并定期合并.

But here is an easier but partial solution that perhaps is good enough for your needs. Just fork and periodically merge back.

  1. 分叉(克隆)存储库
  2. 删除不需要的部分并将子文件夹移动到需要的位置
  3. 提交

将来,当您想与上游 Git 代码同步备份时,只需将其与您的 fork 合并即可.您保留的文件将与来自上游的文件同步备份,您可能需要进行一些小的清理工作,从 git status 中很容易看到.

In the future, when you want to sync back up with the upstream Git code, just merge it with your fork. The files which you kept will sync back up with those from upstream, and you might have some small cleanups to do which are easy to see from git status.

这篇关于克隆 github 项目的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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