I wanted to do the equivalent of this, but in magit
git remote rename origin github
git remote add codeberg https://codeberg.org/jkreeftmeijer/ox-md-title.el.git
git remote add origin https://codeberg.org/jkreeftmeijer/ox-md-title.el.git
git remote set-url --add --push origin https://codeberg.org/jkreeftmeijer/ox-md-title.el.git
git remote set-url --add --push origin https://github.com/jeffkreeftmeijer/ox-md-title.el
git remote show origin
* remote origin
Fetch URL: https://codeberg.org/jkreeftmeijer/ox-md-title.el.git
Push URL: https://codeberg.org/jkreeftmeijer/ox-md-title.el.git
Push URL: https://github.com/jeffkreeftmeijer/ox-md-title.el
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:
M r
,origin
,andylu
Adding another remote was also simple:
M a
,github
,[email protected]:blah.git
Adding origin back in was just:
M a
,origin
,ssh://[email protected]:1702/blah.git
Setting multiple push remotes took bit of work to figure out. Ultimately, you just give it a comma-space separated list of push URLs:
M C
,origin
,s
,ssh://[email protected]:1702/blah.git, [email protected]:blah.git
Last thing was setting the push remote default back to origin
:
P C
, hitp
untilorigin
is highlighted