Git

OpenSSL SSL_read: Connection was reset, errno 10054

git config --global http.sslVerify "false"

代理如何处理(timeout问题)

# 动态代理查询
git config --global http.proxy
git config --global https.proxy
# 结束代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 设置代理
git config --global http.proxy 127.0.0.1:1080
git config --global https.proxy 127.0.0.1:1080

github.com响应时间过长怎么解决

  1. 选择TTL值最小IP:站长工具
  2. 修改c:\Windows\System32\drivers\etc\hosts
140.82.114.3  github.com
199.232.69.194 github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
  1. 刷新dns ipconfig /flushdns,可通过ipconfig /displaydns查看设置的dns

git clone 鉴权失败如何解决

  1. 个人中心 - Settings - Developer settings - Personal access tokens - Generate new token
  2. 命名token,并设置为永不过期,允许权限为delete_repo, repo
  3. 保存token(因刷新页面后消失)
  4. 使用token作为密码来拉去代码

如何变更使用用户

  • 查看当前的使用用户是谁
git config --list
git config user.name
git config user.email
  • 变更用户
git config --global user.name xxx
git config --global user.email yyy

pull时重复要求输入用户名和密码怎么解决?

git config —global credential.helper store

如何删除分支

git checkout master
git branch -d test
git push origin :test

如何回滚文件

  • 已mod,未add
    git checkout -- filename
  • 已add,未commit
    git reset HEAD filename
  • 已commit
    查看提交历史git log
    回滚到指定版本git reset --hard commitid
    push到远程git push -f origin test (git push -f即为强制覆盖远程文件)

如何设置显示中文名

git config --global core.quotepath false

posted @ 2021-11-18 09:49  chengjunjie  阅读(31)  评论(0)    收藏  举报