本地被GIT管理代码更换GIT远程仓库命令

 

1.在新GIT仓库创建一个新的仓库存放本地代码(什么文件都不要)

2.查看本地代码关联GIT地址

git remote -v

3.删除本地的远程仓库地址

git remote remove origin

4.绑定新的GIT地址

git remote add origin 自己新创建的远程仓库地址

5.将本地代码推送至远程仓库

git push origin master

报错:

git pull <remote> <branch> 
 
If you wish to set tracking information for this branch you can do so with: 
 
git branch --set-upstream-to=origin/<branch> master

解决:https://blog.csdn.net/weixin_30735391/article/details/95893550

posted @ 2022-01-25 16:42  唐胜伟  阅读(388)  评论(0编辑  收藏  举报