1.将git远程换名称
git remote rename origin lost
查看
git remote -v
2. 添加第二个仓库地址a
git remote add origin http://gitlab.a.com/ldd/company_java.git
3.拉取
这时候用git pull 不能拉取新地址的代码。使用git pull origin dev
4.推送
使用git push 会出现如下错误
git push
fatal: The current branch dev has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin dev
解决办法
git config --global push.default current
再使用git push,就可以了
5.和远程分支建立关系
git branch --set-upstream-to=origin/<branch> dev