coding项目新建
coding上面的项目,切换远程仓库遇到的问题
本来在coding上面的项目,我想把它的远程仓库的地址更换一下,遇到的问题总结一下:
1.切换远程仓库
2.关联远程仓库
3.新建分支
4.push reject
Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. ‘git pull …’) before pushing again.
- 切换远程仓库有三种办法
- 修改命令
git remote origin set -url [your url] - 先删后加
git remote rm origin
git remote add origin [url] - 直接修改config 文件
- 修改命令
rm
Remove the remote named . All remote-tracking branches and configuration settings for the remote are removed.
移除所有远程仓库信息,所有的远程追踪分支和配置信息都被移除。
如果你想新建一个分支,可以直接在本地新建,然后push到远程。
git branch name
关联分支
git branch –set-upstream-to=name
git push origin name:name
就可以在coding 上面查看