0%

github相关

gitgub相关的问题

1. 访问github的权限问题

  1. github 端生成token

    github的账户设置界面,找到开发者设置

    image-20221215210441409

    选择私有访问tokens

    image-20221215205624318

    生成一个新的token

    image-20221215205428517

    填写token名,选择该token的访问权限

    image-20221215204334098

    生成token

    image-20221215205533434

    • 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
  2. Windows客户端增加凭证

    image-20221215205835061

    image-20221215210311885

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

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

1
2
3
4
5
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  1. 检查SSH是否连接成功

    1
    2
    3
    ssh -T git@github.com
    # 报错
    ssh: connect to host github.com port 22: Connection timed out
  2. 配置文件

    新建config文件

    image-20221215195509518

    编辑配置文件

    1
    2
    3
    4
    5
    6
    Host github.com
    User YourEmail@163.com #只需要改邮箱
    Hostname ssh.github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa
    Port 443

    执行 ssh -T git@github.com ,输入 yes 即可。

    image-20221215200711461

    image-20221215200747718

之后就能上传代码了。

-------------本文结束-------------