Skip to content

Instantly share code, notes, and snippets.

@lidgnulinux
Last active January 8, 2026 02:50
Show Gist options
  • Select an option

  • Save lidgnulinux/f6031c027ed55eefae8a5f522d4870fa to your computer and use it in GitHub Desktop.

Select an option

Save lidgnulinux/f6031c027ed55eefae8a5f522d4870fa to your computer and use it in GitHub Desktop.
Push change(s) to codeberg without username & password prompt.

Pushing to codeberg without prompting username & password.

Requirements

  • ssh.
  • terminal.
  • text editor.

Steps

  1. Generate ssh key !

    $ ssh-keygen -t ed25519 -a 100
    
  2. Add it to cedeberg.org !

    -> Settings

    -> SSH / GPG keys

    -> Manage SSH keys

    -> add key

    -> Fill "Key name" !

    -> Fill Content with your public key / your-private-key.pub !

    -> Add key

  3. Add these lines to your ssh config / ~/.ssh/config !

    Host codeberg.org 
     Hostname codeberg.org
     User git
     IdentityFile ~/.ssh/your-private-key
    
  4. Test it using this command to make sure it works !

    $ ssh -T [email protected]
    

    if it works, you will get this kind of outputs :

    Hi there, your_username ! You've successfully authenticated with the key named codeberg.pub, but Forgejo does not provide shell access. 
    If this is unexpected, please log in with password and setup Forgejo under another user.
    
  5. Enter your local repository and set the remote url !

    $ git remote set-url origin [email protected]:your_username/your_repository.git
    
  6. Try add stuff, commit it and push it to your remote repository !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment