首页 > 其他 > 详细

git branch

时间:2019-10-14 11:51:23      阅读:67      评论:0      收藏:0      [点我收藏+]

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
    • git remote add azure url
  • 将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/*

 

git branch

原文:https://www.cnblogs.com/chucklu/p/11670097.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!