1

In other words, I have a repo up on Github called st3_packages (https://github.com/pitosalas/st3_packages).

I want to do a git clone and have it create a directory on my local computer called "Packages".
Is that possible?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
pitosalas
  • 10,286
  • 12
  • 72
  • 120

1 Answers1

7

Yes, it is possible:

git clone https://github.com/pitosalas/st3_packages Packages

You can specify the local root directory when using git clone.

<directory>

The name of a new directory to clone into.
The "humanish" part of the source repository is used if no directory is explicitly given (repo for /path/to/repo.git and foo for host.xz:foo/.git).
Cloning into an existing directory is only allowed if the directory is empty.


As Chris comments, you can then rename that top directory.
Git only cares about the .git within said top folder, which you can get with various commands:

git rev-parse --show-toplevel
git rev-parse --git-dir
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250