从远程仓库拉去的代码开发后用git推送到另外一个远程仓库

1.查看当前的远程链接的仓库

git remote

  

2.本地添加要推送的远程仓库链接

git remote add repoName url

3.推送

git push repoName branch1:branch2
info:该步骤需要输入对应gitlab/github的账号和密码
desc:
branch1是本地要推送的代码所在分支
branch2是要把代码推送到repoName对应远程仓库的分支

例子

git remote add origin2 http://xxx.git
git push origin2 dev:dev
原文地址:https://www.cnblogs.com/juna3066/p/14172918.html