Andy's Cafe

Magit: Multiple Push Remotes

Last updated :

I wanted to do the equivalent of this, but in magit

git remote rename origin github

git remote add codeberg
git remote add origin

git remote set-url --add --push origin
git remote set-url --add --push origin

git remote show origin

* remote origin
  Fetch URL:
  Push  URL:
  Push  URL:
  HEAD branch: main
  Remote branch:
    main new (next fetch will store in remotes/origin)
  Local ref configured for 'git push':
    main pushes to main (up to date)


Renaming was easy:

Adding another remote was also simple:

Adding origin back in was just:

Setting multiple push remotes took bit of work to figure out. Ultimately, you just give it a comma-space separated list of push URLs:

Last thing was setting the push remote default back to origin:

Reply via email


#emacs   #magit