git: how to copy code from one remote to another

Sergey Royz
Jun 18, 2021

Let’s say you have an origin and you need to push the code to another remote fork which is currently empty

git remote add fork git@host:aaa/bbb.gitgit push fork 'refs/remotes/origin/*:refs/heads/*'
git push fork 'refs/tags/*:refs/tags/*'

--

--

Sergey Royz

Co-founder and CTO of a crypto startup. A full-stack software engineer with a passion for creating innovative tech solutions that make a difference.