docs: add instructions for how to clone a private repository from the command line #459
Labels
No labels
Codeberg Pages
Documentation Usability
Forgejo
Good First Issue! 👋
Kind: Bug
Kind: Documentation
Kind: Enhancement
Kind: Feature
Kind: Question
Kind: Security
Licensing
Part: Generator
Priority: High
Priority: Low
Priority: Medium
Reviewed: Confirmed
Reviewed: Duplicate
Reviewed: Invalid
Reviewed: Wontfix
Status: Blocked
Status: Help wanted
Status: In progress
Status: Needs feedback
Status: Ready for Review
Status: Review
Status: Stale
No milestone
No project
No assignees
7 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Documentation!459
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mark-pitblado/codeberg-documentation:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #458. Tested the oauth2 protocol described by soas in the issue description and confirmed it is functional.
Added a note about scoping the token to have the minimum viable permission scope (read/write repos).
Changed the public repo clone instructions to use
user/repoinstead ofknut/examplesas I believe we agreed to move away from references to that example repo.@ -25,0 +28,4 @@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`. You only need to scope the access token to have read/write access to repositories for this operation.nit:
url->URLIt might be best to mention that we recommend SSH for that matter, or perhaps moving the SSH instructions over HTTP ("in order of preference").
@ -31,3 +20,3 @@### SSHBefore you are able to access Git repositories via SSH, you need to [add an SSH key to your account](/security/ssh-key).SSH is the recommended method to use to access your online repository. Before you are able to access Git repositories via SSH, you need to [add an SSH key to your account](/security/ssh-key).I'm a bit hesitant to add this paragraph, SSH is a good method, but if you have a password protected SSH key or a security key backed one that requires user verification, which makes Git operations time costly when it's not necessary against public repositories (which should be the major use case on Codeberg), only for a push operation SSH should be preferred. It's a bit out of this scope of this PR to add instruction how to do a HTTP-by-default setup but only on push operations use SSH, so I would recommend leaving this paragraph out for now.
LGTM.
Hi thanks for doing that!
I don't know if this should be done here, or there. Or maybe make a PR? If it's not too elaborate to set up locally I might be able to do that but not sure if I would be waiting for this change to be completed, or making it against the proposed commit, or what. So if it's simpler to just take from this whatever is useful probably better.
This is suggestions to make things extremely explicit. But it destroys the terseness so idk might not be appreciated. It depends who is your target audience really.
This is the exact version I am looking at, in case it changes in the future: 9f7d0bad4a/content/git/clone-commit-via-cli.md
Suggest to add somewhere:
Suggesting changing:
to something less technical. Assuming I understood the instructions correctly would be like:
Suggest adding how to convert to SSH; something like:
For more detailed instructions, please refer to Changing your repository's transport from HTTPS to SSH
@ -55,0 +55,4 @@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`. You only need to scope the access token to have read/write access to repositories for this operation.```shell~$ git clone https://oauth2:token@codeberg.org/user/repo.gitoauth2is not necessary. The username can be any value. Alternatively, you can use the token as the username and omit the password likehttps://token@codeberg.org/user/repo.gitIt may also be pertinent to mention in the line above that read only access to repositories is sufficient for cloning and fetching a private repo, but a token with write access is required to push to any repository via https if you have 2fa enabled.
@crystal it doesn't need to be a comprehensive examination of every possible use case. It just needs to help people to get going. Is anything wrong here in a way that prevents it from working?
I didn't quite understand the thing about 2fa but maybe it should be included. Is it a separate PR?
I have removed the oauth2 requirement based on crystal's feedback. Clarified that read access is all that is required if the user only wishes to clone or fetch. SSH section is first but recommendation is removed.
I hope that I have not messed up the git history with the rebase, if I have happy to correct and my apologies.
@mark-pitblado Seems some merge issue occurred. Do you wanna cleanup or maybe transfer everything to a new PR?
Rebased it in #738, thus closing here.
Didn’t work properly, thus re-opening this one, here.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.