已迁移-Git - 常见报错

error: remote origin already exists.

这个报错产生的原因,在于你之前已经添加了远程仓库地址,然后你又重复添加了一次,所以提示远程仓库地址已经存在了。

12061@zhangkai MINGW64 /d/mydata/ppqb (master)
$ git remote add origin https://gitee.com/wangzhangkai/ppqb.git
error: remote origin already exists.

如果就是想用当前这个远程仓库地址覆盖掉原来的仓库地址(可能原来的仓库地址写错了等等情况,需要更改),那么你可以先把原来的删掉,再重新添加,也就是执行下面两个命令:

# 1. 删除之前的origin
# 2. 从新添加
git remote remove origin
git remote add origin https://gitee.com/wangzhangkai/ppqb.git

ping github.com请求超时

win11

没有FQ软件的情况下,本地访问github失败:

C:\Users\Administrator\Desktop\shujukaifakecheng\mokuaisix\mokuai6-disanzhang-git-bili\dbhot>ping github.com

正在 Ping github.com [192.30.253.112] 具有 32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。

192.30.253.112 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 0,丢失 = 4 (100% 丢失),

解决办法:

  1. 关闭你的FQ软件。
  2. 打开你的本地hosts文件,路径是C:\Windows\System32\drivers\etc
  3. 访问这个页面:https://tool.chinaz.com/dns,输入github.com,然后点击立即检测。

  1. 将解析时间最短的那个IP添加到hosts文件中。
20.205.243.166 github.com
  1. 重新尝试再ping一下。应该就可以了。

参考:https://www.zhihu.com/question/472533878/answer/2580095824?utm_id=0

posted @ 2023-05-24 10:10  听雨危楼  阅读(25)  评论(0编辑  收藏  举报