computing:git:clone-remote-repo
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| computing:git:clone-remote-repo [2026/08/28 09:38] – oscar | computing:git:clone-remote-repo [2026/12/01 04:42] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Clone a remote Repo ====== | ||
| - | ==== Clone Repo ==== | ||
| - | Go into the directory, where you want to receive the directory of the repository to be cloned: | ||
| - | To clone a repository from a remote to your local machine, use git clone: | ||
| - | $ git clone < | ||
| - | The < | ||
| - | < | ||
| - | $ git clone http:// | ||
| - | --------------------------------------------------------- | ||
| - | Cloning into ' | ||
| - | remote: Enumerating objects: 139, done. | ||
| - | remote: Counting objects: 100% (139/139), done. | ||
| - | remote: Compressing objects: 100% (98/98), done. | ||
| - | remote: Total 139 (delta 38), reused 139 (delta 38), pack-reused 0 | ||
| - | Receiving objects: 100% (139/139), 1.84 MiB | 41.92 MiB/s, done. | ||
| - | Resolving deltas: 100% (38/38), done. | ||
| - | </ | ||
| - | This creates a new folder named after the repo (homesite) into your current working directory, containing the full project and its git history, already **connected to the remote as origin**. | ||
| - | ==== After cloning ==== | ||
| - | Change into the repo directory and you're ready to work with it. If you want to confirm the remote is set correctly, run git remote -v inside the folder — it should show origin pointing to the URL you cloned from. | ||
| - | < | ||
| - | $ cd homesite | ||
| - | $ git remote -v | ||
| - | --------------- | ||
| - | origin http:// | ||
| - | origin http:// | ||
| - | </ | ||
| - | ==== Usefull alternatives ==== | ||
| - | < | ||
| - | # Clone into a specific folder name | ||
| - | git clone < | ||
| - | |||
| - | # Clone only a specific branch | ||
| - | git clone -b branch-name < | ||
| - | |||
| - | # Shallow clone (only latest commit, faster for large repos) | ||
| - | git clone --depth 1 < | ||
| - | </ | ||
computing/git/clone-remote-repo.1787909933.txt.gz · Last modified: by oscar
