git push出现could not resolve host:github.com标题处置惩罚

分享
手机游戏开发者 2024-9-8 04:40:29 155 0 来自 中国
1、打开终端,输入:ping github.com

2、修改/etc/hosts文件:点击桌面、利用快捷键:command+shift+G,填入路径:/etc/hosts

2.png 3、在hosts文件中底部添加 20.205.243.166 github.com

固然hosts是不能直接需改的


复制一个副本,添加完之后,举行更换
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/gitXiaoWangZi/SJ_Swift_Library/'
4.png 长途推送时链接https方式用户名暗码总是堕落,可利用SSH 方式
私钥秘钥设置
设置完之后就可以利用SSH
查察长途库
git remote -v

5.png
假如想更换长途库
git remote rm master //排除与master的关联,长途库并不会删除,只是排除关联git remote add <新起名字> 长途ssh链接//比如:git remote add master git@github.com:***/SJ_Swift_Library.git//更换长途库名字git remote rename <新名字> <旧名字> //比如:git remote rename origin master//假如删除完了,可以重新添加长途链接git remote add <给长途库起个名字> 长途ssh链接git remote add origin git@github.com:***/SJ_Swift_Library.git
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2025-2-1 21:01, Processed in 0.173891 second(s), 35 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表