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 stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
Edward Ned Harvey
  • 5,718
  • 4
  • 32
  • 41

0 Answers0