我设置了以下 Remote :

$ git remote
korg
rorg

和以下分支:
$ git branch -a
* (no branch)
  remotes/korg/gingerbread
  remotes/korg/gingerbread-release
  remotes/korg/honeycomb
  remotes/korg/honeycomb-mr1-release
  remotes/korg/master
  remotes/m/android-2.3.3_r1 -> refs/tags/android-2.3.3_r1a
  remotes/m/gingerbread -> korg/gingerbread

现在我希望将所有远程分支从korg推送到rorg远程。我怎么做?

如果可以避免的话,最好不要先为每个分支创建局部分支。

最佳答案

对一些临时存储库进行的快速测试表明,您可以构造一个可以执行此操作的refspec:

$ git push rorg origin/one:refs/heads/one
Counting objects: 5, done.
Writing objects: 100% (3/3), 240 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /tmp/rorg
 * [new branch]      origin/one -> one

所以origin / BRANCHNAME:refs / heads / BRANCHNAME

checkin rorg Remote :
pat@host /tmp/rorg (BARE:master)
$ git graph --all
* 5750bca (HEAD, master) c
| * 13fd55a (one) b
|/
* 822e0de a

08-26 14:07