检查远程仓库
git remote -v
结果如下:
origin https://github.com/sanworldwar/learngit.git (fetch)
origin https://github.com/sanworldwar/learngit.git (push)
或者
origin git@github.com:sanworldwar/learngit.git (fetch)
origin git@github.com:sanworldwar/learngit.git (push)
第一个是https方式,第二个ssh方式,如果一个不行换另一个
方法:
git remote set-url origin git@github.com:sanworldwar/learngit.git
或
git remote set-url origin https://github.com/sanworldwar/learngit.git