Gitlab新建项目push报 remote origin already exists

Posted 隔壁小王66

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Gitlab新建项目push报 remote origin already exists相关的知识,希望对你有一定的参考价值。

场景:新建项目-push模版项目,因为clone模版项目的时候已经关联remote origin,所以此文记录如何解决此类问题

  • git remote add origin 远程地址.git
    因为已经关联了remote origin,所以需要先删除
  • git remote rm origin
    删除之后在去进行关联,执行步骤1
  • 执行完之后,提交文件会报错 repository ‘xxx.git/’ not found
  • 继续第二步,删除remote origin,重新关联,不同的是,需要把git 的用户名,密码输入到origin地址中,如【http://git用户名:git密码@gitlab.sys.bandubanxie.com/wangchang/mcadm.git】
  • git remote -v 会发现关联的remote origin 已经携带了用户名以及密码
  • git push origin master 执行push,提交代码即可

以上是关于Gitlab新建项目push报 remote origin already exists的主要内容,如果未能解决你的问题,请参考以下文章

Gitlab新建项目push报 remote origin already exists

VScode卸载重装后GitLab克隆报错问题

git拉取GitLab工程报错Repository not found

coco2dx新建项目报错,ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command

新建的maven项目直接用maven编译报错

gitlab 错误处理