0

I came from perforce background. There are client spec which allow p4 work tree has different directory structure from files in the depot. Now with git, I need files from two git repositories to build my project, say repo A and B. I do not need everything in B, but I only need a sub-directory B/C, to placed in side work tree of A.

-A
 |--some--content-in-A
 |--other-content-in-A
 |--C 

Currently, I use google repo to manage both A and B. My work around around is to check out entire B and copy C into its place by using directory copy from repo (an extention of file copy)

-A
 |--some--content-in-A
 |--other-content-in-A
 |--B
 |  |--other-content-in-B
 |  |--C
 |--C(copied from B/C)

What I really need is the capability of only check out directory C from repo B and put it in the top level. If I use sparse checkout, I can achieve only checkout directory C, but it will but in A/B/C instead of A/C. Any help is appreciated.

Hugo y
  • 1,421
  • 10
  • 20
  • I found [this question](https://stackoverflow.com/questions/35097530/git-sparse-checkout-without-leading-directories) is very similar to what I asked. But there is not solution yet. – Shufeng Bai Jul 03 '19 at 05:28
  • found another [question](https://stackoverflow.com/questions/48422349/how-to-checkout-git-repo-subdirectory-into-current-directory) which is similar to what I need. – Shufeng Bai Jul 03 '19 at 05:54

0 Answers0