项目场景: Git网址更换,在本地push代码时报错。 问题描述 git push -u origin main时报错,显示网址不存在 原因分析: gitlab的网址更换,未通知。 解决方案: 断开已失效的远程仓库连接, 建立新的连接 查看当前远程仓库连接 删除现有远程仓库连接 添加新的远程仓库连接 git remote -v git remote remove origin git remote add origin https:xxxx 推送本地更改到新的远程仓库