Search code examples
gitgit-clone

git clone remote to remote without local copy


I want to clone from a remote A, and I want to push the clone to another remote B. I'm aware I can do this with 2 lines to have a bare clone from A to local and push to remote B.

Is this also possible without a local intermediate clone (similar to how we can pipe output from a first shell command directly to second shell command)?

Impersonation on the first remote via SSH shell or similar tricks are not possible for my scenario.


Solution

  • There is no easy way to do that, You can try to manipulate git-fetch-pack and pipe the bundle into git-send-pack but your use case is not what these plumbing programs are intended for hence no simple way.