diff --git a/content/git/clone-commit-via-cli.md b/content/git/clone-commit-via-cli.md index deb60b5..bfe305d 100644 --- a/content/git/clone-commit-via-cli.md +++ b/content/git/clone-commit-via-cli.md @@ -18,18 +18,7 @@ The repository was created via the Codeberg website, including a `README.md` fil ### Clone _Cloning_ refers to the process of creating an identical copy of an online repository to your local machine. -Clone with the Git command `clone` followed by the repo URL. - -#### HTTP - -```shell -~$ git clone https://codeberg.org/knut/examples.git -Cloning into 'examples'... -remote: Enumerating objects: 3, done. -remote: Counting objects: 100% (3/3), done. -remote: Total 3 (delta 0), reused 0 (delta 0) -Unpacking objects: 100% (3/3), 214 bytes | 1024 bytes/s, done. -``` +It is performed using the Git command `git clone` followed by the [SSH](#ssh) or the [HTTP](#http) repository URL. #### SSH @@ -55,6 +44,28 @@ remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. ``` +#### HTTP + +```shell +~$ git clone https://codeberg.org/knut/examples.git +Cloning into 'examples'... +remote: Enumerating objects: 3, done. +remote: Counting objects: 100% (3/3), done. +remote: Total 3 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (3/3), 214 bytes | 1024 bytes/s, done. +``` + +If you wish to clone a private repository, simply add an [access token](/advanced/access-token/) from your account into the URL passed to `git clone`. If you only want to clone or fetch from the repository, the token only needs read access. If you want to push to the repository, write access is needed. + +```shell +~$ git clone https://token@codeberg.org/knut/examples.git +Cloning into 'examples'... +remote: Enumerating objects: 3, done. +remote: Counting objects: 100% (3/3), done. +remote: Total 3 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (3/3), 214 bytes | 1024 bytes/s, done. +``` + ### Edit Modify an existing file: