2

I have a large legacy repo, of which I am only interested in the widgets directory. By using a git sparse checkout I am able to download only the folder I am interested in, which is nice.
My local repo now looks likes this:

/.git
/blah/blah/blah/blah/widgets/foo-widget.f90

I would prefer to not see all that nesting.
Is there some variation on a sparse checkout whereby I could have my local repo look like this instead?

/.git
/widgets/foo-widget.f90

I am aware that I could just create a new repo, but then I would loose the ability push and pull from the remote repo.

Buh Buh
  • 7,443
  • 1
  • 34
  • 61
  • This is not quite what you're asking, but a symlink is the first thing that comes to mind... – joanis Mar 20 '19 at 18:37
  • @joanis I looked at that but Im on Windows. As I understand it, symlinks are Linux only. – Buh Buh Mar 20 '19 at 19:04
  • Yeah, the Windows concept is links is pretty weak. You can click on them interactively to get somewhere, but that's pretty much it, they don't behave at all like *nix symlinks so forget that idea... – joanis Mar 20 '19 at 20:17

1 Answers1

1

As I understand it, symlinks are Linux only

No, they are available in Windows too. And since Windows 10 Insiders build 14972 (2017), symlinks can be created without needing to elevate the console as administrator.

So once you have cloned your repo, you can add a symlink and work with the desired directory structure.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250