> 文章列表 > 【杂项】git问题汇总

【杂项】git问题汇总

【杂项】git问题汇总

ssh: connect to host github.com port 22: Connection timed out

1. 检查SSH是否连接成功

ssh -T git@github.com
# 报错
ssh: connect to host github.com port 22: Connection timed out

2. 配置文件

  1. 新建 config 文件

    【杂项】git问题汇总

  2. 编辑配置文件

    Host github.com
    User YourEmail@163.com #只需要改邮箱
    Hostname ssh.github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa
    Port 443
    
  3. 执行 ssh -T git@github.com ,输入 yes 即可。

    【杂项】git问题汇总

    【杂项】git问题汇总

之后就能上传代码了。

git push 权限

1. 生成token

  1. Goto settings of Github account

  2. Find and Select Developer Settings

    【杂项】git问题汇总

  3. Find and Select Personal access tokens

    【杂项】git问题汇总

  4. Generate a new token

    【杂项】git问题汇总

  5. Fill in any note and select the access scopes

    【杂项】git问题汇总

  6. once done click on generate token

    【杂项】git问题汇总


2. 新增Windows凭证

【杂项】git问题汇总
【杂项】git问题汇总


3. 之后有个密码验证,验证过了就行