Git push branch from one remote to another?
A quick test making some temporary repositories shows you can construct a refspec that can do this:
$ 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
So origin/BRANCHNAME:refs/heads/BRANCHNAME
Checking in my rorg remote:
- Clone一个本地干净的库 或者 使用你本地的一个库
- 命令行新增一个remote 叫azure
- 将remote/origin中的所有分支全部推到azure中
- git push azure refs/remotes/origin/*:refs/heads/* //make sure the previous remote name is origin
- 使用同样的方法将tags都推到azure中
- git push azure refs/tags/*:refs/tags/*