Skip to content

git clone to a location

github-actions[bot] edited this page Apr 27, 2026 · 2 revisions

User tools & setup > git clone to a location

git clone usage

By default, git repositories are cloned into the current directory (usually ~/home). You can specify the intended location for a repository using:

 $ git clone <repository-url> <destination-folder>

Considerations

  • If this directory already exists, it must be empty, otherwise you will get an error.

  • If this directory does not exist, creates a new directory at the specific path.

Tip

You can clone a repository's contents into the current directory by using git clone <repo-url> .
Since this clones all content into the current location, it is important to change directories (using cd) into the correct directory first, lest files explode everywhere.

See: cd manpage, git

Clone this wiki locally