docs: tutorial for pats #27

Merged
silver merged 1 commit from token-tutorial into main 2024-09-13 21:19:38 +00:00
Showing only changes of commit e2ac80381e - Show all commits

View file

@ -0,0 +1,24 @@
# Personal Access Tokens
## Assumptions
* [Git installed](https://git-scm.com/downloads)
* [Skynet / Forgejo account](https://forgejo.skynet.ie/user/login)
### Why
The usual way of authentication when working with remote git repositories
is SSH, unfortunately we aren't able to do that with our git server. You could use username and password
however that is less secure and inconvenient, personal access tokens on the other hand are a more convenient and secure alternative.
Personal access tokens make it so you don't have to use username / password
to authenticate, you can authenticate **once** when **cloning** and that's it.
### How
Go to [this page and click generate token](https://forgejo.skynet.ie/user/settings/applications)
Give it a name and select read and write for repository permissions
Copy it once its generated
**Note : Do not share your access token with anyone, if its compromised delete it, this can be done easily
[here](https://forgejo.skynet.ie/user/settings/applications) and prevents it from being used.**
When cloning a repository, use the token like so..
```git clone https://<token>@forgejo.skynet.ie/<repo>```
You now should be able to push to the repository without being prompted for username / password.