git操作提示warning: redirecting to [email protected]:XXXXX

本文详细描述了如何处理git clone和git push/pull过程中频繁出现的'warning:redirecting to'提示,包括移除并重新设置origin,以及针对https方式的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、前提:

常用git clone 有两种方式

ssh方式:git@github.com:Nehic/demo.git

https方式:https://github.com/Nehic/demo.git

查看方式:gitlab或者github等的clone里面

二、问题描述:

每次git操作都提示:
warning: redirecting to git@github.com:Nehic/demo.git

git push和git pull均失败

三、解决方式
// 移除所有origin
git remote remove origin

// 重新设置origin
git remote add origin git@github.com:Nehic/demo.git

// pull一下看还会不会提示warning: redirecting to XXX
git pull

// 如果还会提示则再进行一遍,但是origin采用https的方式
git remote remove origin
git remote add origin https://github.com/Nehic/demo.git
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值