转载请注明出处:www.huamo.online
字节杭州 求贤若渴:
项目代码推送到另一个远程仓库
例如现在有一个项目test
,并且在本地dev
分支做开发,这个dev
分支跟踪了远程的分支为origin/dev
。现在的需求是:将test
项目代码推送到另一个仓库another
的prd
分支上
添加remote
1 | $ git remote add another https://git.com/another |
拉取another
的prd
分支
1 | $ git fetch another prd |
本地建立prd
分支跟踪another/prd
1 | $ git checkout -b prd another/prd |
到这里,你已经自动切换到了
another/prd
分支上了
拉取another/prd
更新
1 | $ git pull another prd:prd |
将dev
分支代码全部合并到prd
分支中
1 | $ git branch -vv |
推送代码到another/prd
分支中
1 | $ git add . |
转载请注明出处:www.huamo.online