Context: I have the origin remote with a the default url after cloning a repo. Because of some Bitbucket updates it was suggested that our team would centralize the repositories by creating another account with one App password for all the projects that the team handles.
At first, I've decided to add another remote using:
git remote add norigin <new url>
But pushing to two remotes every time would prove to be a hassle. My search for an one push command solution brought me here.
Basically you can edit/add another url to an existing remote, thus I entered:
git remote set-url --add --push origin git@bitbucket.com:username/repo2
Tested if the now git push origin <some branch> command would push to both remote urls. The git log would then show that norigin would be behind by a single commit than the origin, but I thought it's because it's treated still as a another individual remote, then checked each individual repo and it was indeed pushing to both repos, thus I deleted the norigin remote.
All's good but when I enter git remote -v it would only show:
origin git@bitbucket.com:username/repo (fetch)
origin git@bitbucket.com:username/repo2 (push)
When the expected output should be:
origin git@bitbucket.com:username/repo (fetch)
origin git@bitbucket.com:username/repo (push)
origin git@bitbucket.com:username/repo2 (push)
The Question: as the title says and the expected output shown, how do you show all the urls added on a specific remote?
What I've tried:
git remote -v show origin
git remote get-url --push origin
git remote get-url --all origin
but all of them return a single url, and it's either the old or the new url.