Auth with Forgejo Tokens
This is how you can push to Codeberg without entering your login password.
Steps ¶
Generate an access token on your Forgejo instance for your account.
- In the case of Codeberg, login and go to: https://codeberg.org/user/settings/applications
Before generating token, optionally select permissions for your token.
Copy your token and keep it somewhere safe. It will not be shown again!
Now you can commit with username
oauth2and your token as password:$ git commit -m 'fixes' $ git push Username for 'https://codeberg.org': oauth2 Password for 'https://codeberg.org': <paste your token>You can also clone your repository with the token:
$ git clone https://oauth2:<token>@codeberg.org/user/repo.gitThis way, auth isn’t needed when pushing to this repository.
You can also modify the URL in.git/configof existing local repositories.Tokens can also be used for automation and oauth2 solutions. Be sure to generate dedicated tokens for each service.
Note ¶
Despite the token is not your login password, it still needs to be keeped secret, and be regenerated in case of potential leakage. No warranty!