1

I am trying to do a sparse checkout without shallo clone. I am able to do this successfully. But the problem is, when I do, the entire folder structure is being created.

For example: I am trying to clone the subdirectory at the path:reponame/path/to/the/directory To the local folder: local_dir

Now after the sparse checkout, the content of the local_dir is like below: local_dir/path/to/the/directory

But I need the content from the folder directory to come directly under local_dir. How do I do this?

Side note: I am trying to do this for a golang project. I need to put the golang project inside an already existing repo under a specific directory structure. So if you have any tips on how to do this, please do let me know. I can't put the entire content of the repo inside the go's working dir path.

Flimzy
  • 68,325
  • 15
  • 126
  • 165
defiant
  • 2,854
  • 10
  • 38
  • 60
  • If you are interested merely in that one directory (and its contents) you can simply a) clone the repository at the root - or any other place in your filesystem - and then b) move/copy that directory to the golang project structure where you need it. – Thom Parkin Feb 08 '18 at 14:22
  • I am trying to avoid doing that every time I change the code in that project. Is there anyway I could achieve that? – defiant Feb 09 '18 at 01:20
  • If I understand you correctly, this is what SUBMODULES is designed to do. https://git-scm.com/book/en/v2/Git-Tools-Submodules – Thom Parkin Feb 15 '18 at 18:06

0 Answers0