Skip to content

Instantly share code, notes, and snippets.

@eggplants
Last active December 6, 2024 17:48
Show Gist options
  • Save eggplants/25dfaa4a6d8198944e2a45984fe9e618 to your computer and use it in GitHub Desktop.
Save eggplants/25dfaa4a6d8198944e2a45984fe9e618 to your computer and use it in GitHub Desktop.
Force git client to select ssh protocol instead of http protocol to connect to Codeberg
#!/usr/bin/env bash
cb_prefix="[email protected]:"
git config --global --remove-section "$gb_prefix" || :
git config --global "$cb_prefix".pushInsteadOf "git://codeberg.org/"
git config --global --add "$cb_prefix".pushInsteadOf "https://codeberg.org/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment