Auth with Forgejo Tokens

This is how you can push to Codeberg without entering your login password

Steps

  1. Generate an access token on your Forgejo instance for your account.

  2. Before generating token, optionally select permissions for your token.

  3. Copy your token and keep it somewhere safe. It will not be shown again!

  4. Now you can commit with username oauth2 with a token as password:

    $ git commit -m 'fixes'
    $ git push
    Username for 'https://forge.unseen-site.fun': oauth2
    Password for 'https://forge.unseen-site.fun': <paste your token>
    
  5. 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!