简体   繁体   English

我该如何从git repo中提取选定的文件

[英]How can i pull selected files from git repo

I have the git repo with folders like 我有git repo和类似的文件夹

|-ear
   |-ejbs
   |---src
   |-----main
   |-------resources
   |---------META-INF
   |-primary-source
   |-projects
   |---logging
   |-servlets
   |---servlet
   |-----src
   |-------main
   |---------webapp
   |-----------WEB-INF
   |-src
   |---main
   |-----resources

This is in git repo on bitbucket 这是在bitbucket的git repo中

However for other project i only want to have folder structure like 但是对于其他项目,我只希望具有以下文件夹结构

|-ear
   |-main
   |-resources
   |-projects --only some files

So that when i use git pull then those files folder gets updated from that repo 这样,当我使用git pull时,这些文件文件夹就会从该存储库中更新

You can't. 你不能

If you only need a subset: 如果只需要一个子集:

  • clone the original repo 克隆原始仓库
  • drop files you don't need 删除不需要的文件
  • commit what's remaining. 提交剩余的内容。

Or, if you're not interested in the history, just create a fresh repo and pick the files you need from ear into your fresh repo. 或者,如果您对历史记录不感兴趣,只需创建一个新的存储库,然后将所需的文件从ear挑选出来即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM