1、git 删除远程地址
git remote rm origin
2、git 更换远程地址
git remote add origin http://10.00.3.260:10080/xxxxxx/sxxxy.git/
3、把当前分支与远程分支进行关联(branchname要改成你的当前分支名称)
git push --set-upstream origin branchname
1) 报错信息:
To http://192.168.0.176:9000/dfas_group/dfas_cloud_core/dfas-monitor.git
! [rejected] dev -> dev (fetch first)
error: failed to push some refs to 'http://192.168.0.176:9000/dfas_group/dfas_cloud_core/dfas-monitor.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
2)报错信息
To http://192.168.0.176:9000/dfas_group/dfas_cloud_core/dfas-monitor.git
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'http://192.168.0.176:9000/dfas_group/dfas_cloud_core/dfas-monitor.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决办法:先fetch->pull->push,
最后执行第3步