git现有项目上传(fatal: remote origin already exists)

概述

idea现有项目需要上传指定的gitee地址,该如何处理,出现以下错fatal: remote origin already exists,该如何解决

使用

一般在gitee上创建一个项目,再将本地项目上传,.gitignore 文件不要忘记

实际场景 如下
在这里插入图片描述

在这里插入图片描述

idea 中即可执行以下命令

appledeMacBook-Pro:spark-demo hyl$ git remote add origin git@gitee.com:long-train/spark-demo.git
fatal: remote origin already exists.
appledeMacBook-Pro:spark-demo hyl$ git remote rm origin
appledeMacBook-Pro:spark-demo hyl$ git remote add origin git@gitee.com:long-train/spark-demo.git
appledeMacBook-Pro:spark-demo hyl$ git add .
appledeMacBook-Pro:spark-demo hyl$ git commit  -m "init"
[master 66dcc3b] init
 1 file changed, 23 insertions(+)
 create mode 100644 .gitignore
appledeMacBook-Pro:spark-demo hyl$ git push -u origin "master"
Enumerating objects: 44, done.
Counting objects: 100% (44/44), done.
Delta compression using up to 8 threads
Compressing objects: 100% (34/34), done.
Writing objects: 100% (44/44), 11.94 KiB | 2.98 MiB/s, done.
Total 44 (delta 2), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To gitee.com:long-train/spark-demo.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
appledeMacBook-Pro:spark-demo hyl$ 

结束

fatal: remote origin already exists. origin已存在,那么删除再重新操作一次
git remote rm origin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

流月up

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值