Git: 将远程 A 分支 Foo 推送到远程 B 分支 bar

huangapple go评论48阅读模式
英文:

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

问题

可以将A/foo推送到B/bar吗,其中AB是不同的远程,显然,foobar是分支名称?

英文:

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?

答案1

得分: 2

是的,您可以简单地首先将它拉到一个临时本地分支,然后推送到远程:

git pull A foo
git push B tmp:bar
英文:

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

huangapple
  • 本文由 发表于 2023年3月7日 05:58:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75656216.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定