一、前提:
常用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