1

Please note: I am not looking for git sparse checkout, nor is this question a duplicate of Is there any way to clone a git repository's sub-directory only?

In git, is it possible to clone or checkout just a subdirectory, into the current directory? In svn, you would do this by extending the URL. For example, instead of checking out http://server/repo you would checkout http://server/repo/subdir

The difference between sparse checkout and checking out only a subdir, is that a sparse checkout still creates a local directory subdir. I don't want a subdirectory called subdir. I want the contents of subdir to be checked out into the top level of my working copy.

An example use case would be:

Zoe
  • 27,060
  • 21
  • 118
  • 148
Edward Ned Harvey
  • 6,525
  • 5
  • 36
  • 45

0 Answers0