2015-10-22 10:31:52 +03:00
|
|
|
# git clone
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Clone an existing repository.
|
2019-06-03 03:06:36 +03:00
|
|
|
> More information: <https://git-scm.com/docs/git-clone>.
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Clone an existing repository:
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2016-09-21 18:35:46 +03:00
|
|
|
`git clone {{remote_repository_location}}`
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2020-11-03 14:48:52 +03:00
|
|
|
- Clone an existing repository into a specific directory:
|
|
|
|
|
|
|
|
`git clone {{remote_repository_location}} {{path/to/directory}}`
|
|
|
|
|
2017-12-28 11:10:06 +03:00
|
|
|
- Clone an existing repository and its submodules:
|
|
|
|
|
|
|
|
`git clone --recursive {{remote_repository_location}}`
|
|
|
|
|
2019-10-27 14:07:00 +03:00
|
|
|
- Clone a local repository:
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2019-10-27 14:07:00 +03:00
|
|
|
`git clone -l {{path/to/local/repository}}`
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2019-10-27 14:07:00 +03:00
|
|
|
- Clone quietly:
|
2014-03-09 16:20:13 +04:00
|
|
|
|
2019-10-27 14:07:00 +03:00
|
|
|
`git clone -q {{remote_repository_location}}`
|
2015-12-25 10:21:32 +03:00
|
|
|
|
2019-10-27 14:07:00 +03:00
|
|
|
- Clone an existing repository only fetching the 10 most recent commits on the default branch (useful to save time):
|
2015-12-25 10:21:32 +03:00
|
|
|
|
2017-12-29 09:02:01 +03:00
|
|
|
`git clone --depth {{10}} {{remote_repository_location}}`
|
2020-11-03 14:48:52 +03:00
|
|
|
|
|
|
|
- Clone an existing repository only fetching a specific branch:
|
|
|
|
|
|
|
|
`git clone --branch {{name}} --single-branch {{remote_repository_location}}`
|