项目场景:
Git bash
问题描述:
进行git remote add origin https://github.com/你的用户名/你的用户名.github.io.git
命令时
出现错误:error: remote origin already exists
原因分析:
与本地仓库关联的远程仓库已经存在,无法进行新的关联
解决方案:
- 删除已关联的远程库
git remote rm origin
- 关联正确的远程仓库
git remote add origin https://github.com/你的用户名/你的用户名.github.io.git
- 推送到正确的仓库
git push -f origin main