如何用git拉特定目录 [英] How to pull specific directory with git

查看:114
本文介绍了如何用git拉特定目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个git的项目,我只想克隆或拉一个特定的目录,像myproject / javascript就像subversion那样。

进行一些更改,提交并重新推回。

有可能吗?

解决方案


  1. cd进入您的回购复制

  2. git fetch

  3. git checkout HEAD路径/ to / your / dir /或/ file




    • (3)中的path / ...开头位于包含... / file的repo根目录下的目录



I have a project with git, and I just want to clone or pull a specific directory, like myproject/javascript just like subversion does.
make some changes, commit and push back again.
It's possible?

解决方案

  1. cd into the top of your repo copy
  2. git fetch
  3. git checkout HEAD path/to/your/dir/or/file

    • Where "path/..." in (3) starts at the directory just below the repo root containing your ".../file"

这篇关于如何用git拉特定目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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