Skip to content

Instantly share code, notes, and snippets.

@ganobrega
Created July 18, 2025 09:42
Show Gist options
  • Save ganobrega/d6081677dc8d612a0f8905e17658d1ab to your computer and use it in GitHub Desktop.
Save ganobrega/d6081677dc8d612a0f8905e17658d1ab to your computer and use it in GitHub Desktop.
GH CLI
Using the gh CLI clearly requires a lot of gymnastics, so you can just do:
TOKEN=$(gh auth token)
`git remote add -t main origin https://[email protected]/username/repo.git`
Alternatively:
`git remote add -t main origin https://$(gh auth token)@github.com/username/repo.git`
(Just replace username/repo.git with your actual repo path.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment