Skip to content
Git
Remote

Remote

Basics

To check the remote address of a project, use

git remote -v

To set the remote address as origin:

# Through HTTPS
git remote set-url origin https://codeberg.org/user/repo.git

# Through SSH
git remote set-url origin ssh://git@codeberg.org/user/repo.git

SSH authentication

Follow the codeberg guide: https://docs.codeberg.org/security/ssh-key/

SSH agent

This guide is taken from this superuser thread

I have found keychain to be the most convenient method of using ssh-agent. To set it up on fish, create the following file in ~/.config/fish/conf.d/keychain.fish:

# To add new SSH key, use:
# set --universal --append SSH_KEYS_TO_AUTOLOAD ~/.ssh/id<keyname>
# To remove a key, remove it from the list using its index:
# set --universal --erase SSH_KEYS_TO_AUTOLOAD[index_of_key]

if status is-login
    and status is-interactive
    keychain --eval $SSH_KEYS_TO_AUTOLOAD | source
end