Search code examples
gitgit-branchgit-remote

Git: push remote A branch Foo to remote B branch bar


Is it possible to push A/foo to B/bar where A and B are remotes( different, obviously ), and foo and bar are branch names?


Solution

  • Yes, you can simply pull it first to a temporary local branch, then push it to the remote:

    git checkout -b tmp
    git pull A foo
    git push B tmp:bar