github.com – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sat, 02 Jul 2022 06:40:02 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 fatal: unable to access ‘https://github.com/shuijingwan/refactoring.git/’: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version https://www.shuijingwanwq.com/2022/07/02/6733/ https://www.shuijingwanwq.com/2022/07/02/6733/#respond Sat, 02 Jul 2022 06:40:02 +0000 https://www.shuijingwanwq.com/?p=6733 浏览量: 90 1、执行命令:git push -u origin main 时,报错:fatal: unable to access ‘https://github.com/shuijingwan/refactoring.git/’: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version。如图1
执行命令:git push -u origin main 时,报错:fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

图1



PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version


2、参考:https://github.com/glennhickey/progressiveCactus/issues/93 。Work for me on Windows: update git to latest version (2.16) and remove old version ( 1.9)。如图2
参考:https://github.com/glennhickey/progressiveCactus/issues/93 。Work for me on Windows: update git to latest version (2.16) and remove old version ( 1.9)

图2

3、查看 Git 的版本:1.9.5。如图3
查看 Git 的版本:1.9.5

图3



PS E:\wwwroot\refactoring> git --version
git version 1.9.5.msysgit.1


4、打开:https://git-scm.com/download/win ,下载安装 64-bit Git for Windows Setup。 5、重启电脑后,查看版本,仍然为 1.9.5,查看环境变量:C:\Program Files\Git\cmd,已经自动修改为 2.3 版本的 path。删除环境变量:C:\Program Files (x86)\Git\bin、C:\Program Files (x86)\Git\libexec\git-core。如图4
重启电脑后,查看版本,仍然为 1.9.5,查看环境变量:C:\Program Files\Git\cmd,已经自动修改为 2.3 版本的 path。删除环境变量:C:\Program Files (x86)\Git\bin、C:\Program Files (x86)\Git\libexec\git-core

图4



PS C:\WINDOWS\system32> git --version
git version 2.36.1.windows.1


6、或者直接卸载 Git 1.9 版本。卸载时环境变量会被自动删除。如图5
或者直接卸载 Git 1.9 版本。卸载时环境变量会被自动删除。

图5

7、再次执行命令:git push -u origin main 时,不再报同样的错误。原因应该在于网络不稳定所导致。


PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': OpenSSL SSL_read: Connection was reset, errno 10054


8、再次执行,弹出 Connect to GitHub 。输入 Personal access token。如图6
再次执行,弹出 Connect to GitHub 。输入 Personal access token

图6



PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': Failed to connect to github.com port 443 after 21030 ms: Timed out
PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': OpenSSL SSL_read: Connection was reset, errno 10054
PS E:\wwwroot\refactoring> git push -u origin main
fatal: 鍝嶅簲鐘舵€佷唬鐮佷笉鎸囩ず鎴愬姛: 401 (Unauthorized)銆?Username for 'https://github.com': shuijingwan
Password for 'https://shuijingwan@github.com':
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/shuijingwan/refactoring.git/'
PS E:\wwwroot\refactoring>


9、提示输入用户名与密码。授权失败。remote:对密码身份验证的支持已于 2021 年 8 月 13 日移除。请改用个人访问令牌。如图7
提示输入用户名与密码。授权失败。remote:对密码身份验证的支持已于 2021 年 8 月 13 日移除。请改用个人访问令牌

图7



PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': Failed to connect to github.com port 443 after 21030 ms: Timed out
PS E:\wwwroot\refactoring> git push -u origin main
fatal: unable to access 'https://github.com/shuijingwan/refactoring.git/': OpenSSL SSL_read: Connection was reset, errno 10054
PS E:\wwwroot\refactoring> git push -u origin main
fatal: 鍝嶅簲鐘舵€佷唬鐮佷笉鎸囩ず鎴愬姛: 401 (Unauthorized)銆?Username for 'https://github.com': shuijingwan
Password for 'https://shuijingwan@github.com':
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/shuijingwan/refactoring.git/'
PS E:\wwwroot\refactoring>


10、参考:https://www.shuijingwanwq.com/2021/12/20/5525/ 。测试连接,打开 Git Bash 输入:ssh -T git@github.com ,测试通过。如图8
参考:https://www.shuijingwanwq.com/2021/12/20/5525/ 。测试连接,打开 Git Bash 输入:ssh -T git@github.com ,测试通过

图8



$ ssh -T git@github.com
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Hi shuijingwan! You've successfully authenticated, but GitHub does not provide shell access.



11、生成新的 Personal access token,删除 .git 目录,重新提交与推送。推送成功。如图9
生成新的 Personal access token,删除 .git 目录,重新提交与推送。推送成功

图9



Administrator@PC MINGW64 /e/wwwroot/refactoring (main)
$ git init
Initialized empty Git repository in E:/wwwroot/refactoring/.git/

Administrator@PC MINGW64 /e/wwwroot/refactoring (master)
$ git add README.md

Administrator@PC MINGW64 /e/wwwroot/refactoring (master)
$ git commit -m "first commit"
[master (root-commit) ba74a0c] first commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README.md

Administrator@PC MINGW64 /e/wwwroot/refactoring (master)
$ git branch -M main

Administrator@PC MINGW64 /e/wwwroot/refactoring (main)
$ git remote add origin https://xxx@github.com/shuijingwan/refactoring.git

Administrator@PC MINGW64 /e/wwwroot/refactoring (main)
$ git push -u origin main
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 239 bytes | 119.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/shuijingwan/refactoring.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

Administrator@PC MINGW64 /e/wwwroot/refactoring (main)
$


]]>
https://www.shuijingwanwq.com/2022/07/02/6733/feed/ 0
删除 GitHub 中的仓库的流程 https://www.shuijingwanwq.com/2022/03/23/6171/ https://www.shuijingwanwq.com/2022/03/23/6171/#respond Wed, 23 Mar 2022 01:15:41 +0000 https://www.shuijingwanwq.com/?p=6171 浏览量: 113

1、删除 GitHub 中的仓库。由于公司安全方面的要求,一些代码不允许放在 GitHub 中。最终决定删除掉。如图1

删除 GitHub 中的仓库。由于公司安全方面的要求,一些代码不允许放在 GitHub 中。最终决定删除掉。

图1

2、打开网址:https://github.com/shuijingwan/weibo ,决定删除掉此仓库。进入 Settings 页面。如图2

打开网址:https://github.com/shuijingwan/weibo ,决定删除掉此仓库。进入 Settings 页面

图2

3、滚动至页面尾部,Danger Zone – Delete this repository 。如图3

滚动至页面尾部,Danger Zone - Delete this repository

图3

4、弹出确认对话框,此操作无法撤消。这将永久删除 shuijingwan/weibo 存储库、wiki、问题、评论、包、机密、工作流运行,并删除所有协作者关联。请输入 shuijingwan/weibo 确认。如图4

弹出确认对话框,此操作无法撤消。这将永久删除 shuijingwan/weibo 存储库、wiki、问题、评论、包、机密、工作流运行,并删除所有协作者关联。请输入 shuijingwan/weibo 确认。

图4

5、跳转至 Confirm access 页面,提示:您正在进入 sudo 模式。需要输入登录密码。如图5

跳转至 Confirm access 页面,提示:您正在进入 sudo 模式。需要输入登录密码。

图5

6、Your repository “shuijingwan/weibo” was successfully deleted.。删除成功。如图6

Your repository "shuijingwan/weibo" was successfully deleted.。删除成功。

图6

]]>
https://www.shuijingwanwq.com/2022/03/23/6171/feed/ 0
Git 推送至 Github 时提示:The authenticity of host ‘github.com (52.192.72.89)’ can’t be established.ECDSA key fingerprint is SHA256:.,在 Windows 10 中配置 GitHub 的 SSH key,生成新的 Personal access token https://www.shuijingwanwq.com/2021/12/20/5525/ https://www.shuijingwanwq.com/2021/12/20/5525/#respond Mon, 20 Dec 2021 06:56:13 +0000 https://www.shuijingwanwq.com/?p=5525 浏览量: 202 1、在执行命令时:git push -u origin master,提示:The authenticity of host ‘github.com (52.192.72.89)’ can’t be established.ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.。如图1
在执行命令时:git push -u origin master,提示:The authenticity of host 'github.com (52.192.72.89)' can't be established.ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.

图1



PS E:\wwwroot\Laravel-8> git remote add origin git@github.com:shuijingwan/hello_laravel.git                             
PS E:\wwwroot\Laravel-8> git push -u origin master
The authenticity of host 'github.com (52.192.72.89)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
PS E:\wwwroot\Laravel-8> git push -u origin master
The authenticity of host 'github.com (52.69.186.44)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,52.69.186.44' (ECDSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
PS E:\wwwroot\Laravel-8> git push -u origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


2、通过 TortoiseGit 推送,仍然报错:Logon failed, use ctrl+c to cancel basic credential prompt.。如图2
通过 TortoiseGit 推送,仍然报错:Logon failed, use ctrl+c to cancel basic credential prompt.。

图2



git.exe push --progress "origin" master:master
Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
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/shuijingwan/yii2-app-advanced.git/'


git 未能顺利结束 (退出码 128) (71079 ms @ 2021/12/17 11:26:10)



3、远程:2021 年 8 月 13 日移除了对密码身份验证的支持。请改用个人访问令牌。远程:请参阅 https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ 了解更多信息。从 2021 年 8 月 13 日开始,我们将在对 Git 操作进行身份验证时不再接受帐户密码,并将要求使用基于令牌的身份验证。 4、配置两步验证,参考网址:https://docs.github.com/cn/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication 。 5、参考网址:https://www.jianshu.com/p/9317a927e844 。生成一个新的 SSH 密钥。打开 Git Bash,输入如下命令,然后连续按三个回车即可:ssh-keygen -t rsa -C “shuijingwanwq@163.com”。密钥保存路径:/c/Users/Administrator/.ssh。id_rsa 是密钥,id_rsa.pub 是公钥。如图3
参考网址:https://www.jianshu.com/p/9317a927e844 。生成一个新的 SSH 密钥。打开 Git Bash,输入如下命令,然后连续按三个回车即可:ssh-keygen -t rsa -C "shuijingwanwq@163.com"。密钥保存路径:/c/Users/Administrator/.ssh。id_rsa 是密钥,id_rsa.pub 是公钥。

图3



$ ssh-keygen -t rsa -C "shuijingwanwq@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:YWBWkzDutd4GQ4/193piCd87MuJ/6HoaeAPeIi+PWRI shuijingwanwq@163.com
The key's randomart image is:
+---[RSA 2048]----+
|      *oo.       |
|     + o..       |
|      . = .      |
|     . + * .     |
|      .ES.. . .  |
|       .o++ .. . |
|       o.=o= o.o.|
|       .B.o.o==+o|
|       ooo.+B+=+o|
+----[SHA256]-----+

Administrator@LAPTOP-9S1INV5O MINGW64 ~
$



6、将 SSH 私钥添加到 ssh-agent,在后台启动 ssh-agent,将 SSH 私钥添加到 ssh-agent。如图4
将 SSH 私钥添加到 ssh-agent,在后台启动 ssh-agent,将 SSH 私钥添加到 ssh-agent。

图4



Administrator@LAPTOP-9S1INV5O MINGW64 ~
$ eval $(ssh-agent -s)
Agent pid 2452

Administrator@LAPTOP-9S1INV5O MINGW64 ~
$ ssh-add /c/Users/Administrator/.ssh/id_rsa
Identity added: /c/Users/Administrator/.ssh/id_rsa (shuijingwanwq@163.com)



7、将 SSH 公钥添加到 GitHub 账户,先复制 SSH 公钥的完整内容(/c/Users/Administrator/.ssh/id_rsa.pub)。如图5
将 SSH 公钥添加到 GitHub 账户,先复制 SSH 公钥的完整内容(/c/Users/Administrator/.ssh/id_rsa.pub)。

图5

8、将公钥添加到 GitHub 账号,先打开 Github SSH 令牌管理页面:https://github.com/settings/keys ,然后把你刚刚复制的令牌按照下图示例添加。如图6
将公钥添加到 GitHub 账号,先打开 Github SSH 令牌管理页面:https://github.com/settings/keys ,然后把你刚刚复制的令牌按照下图示例添加。

图6

9、测试连接,打开 Git Bash 输入:ssh -T git@github.com 。在 PowerShell 中执行仍然报错,但是总体是成功了。如图7
测试连接,打开 Git Bash 输入:ssh -T git@github.com 。在 PowerShell 中执行仍然报错,但是总体是成功了。

图7



PS E:\wwwroot\Laravel-8> ssh -T git@github.com
Warning: Permanently added the ECDSA host key for IP address '192.30.255.112' to the list of known hosts.
Hi shuijingwan! You've successfully authenticated, but GitHub does not provide shell access.


10、测试连接,打开 Git Bash 输入:ssh -T git@github.com 。但是在 Git Bash 中执行成功。


Administrator@LAPTOP-9S1INV5O MINGW64 ~
$ ssh -T git@github.com
Hi shuijingwan! You've successfully authenticated, but GitHub does not provide shell access.




11、再次执行命令时:git push -u origin master,报错:Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.。


Administrator@LAPTOP-9S1INV5O MINGW64 /e/wwwroot/Laravel-8 (main)
$ git push -u origin main
Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://github.com': shuijingwan
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/shuijingwan/hello_laravel.git/'




12、删除目录:.git,重新提交与推送。报错:remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.。


PS E:\wwwroot\Laravel-8> git branch -M main
PS E:\wwwroot\Laravel-8> git remote add origin https://github.com/shuijingwan/hello_laravel.git
PS E:\wwwroot\Laravel-8> git push -u origin main
Logon failed, use ctrl+c to cancel basic credential prompt.
Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://github.com': shuijingwan
Password for 'https://shuijingwan@github.com':
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/shuijingwan/hello_laravel.git/'


13、打开网址:https://github.com/settings/tokens 。Generate new token,勾选所有权限。如图8
打开网址:https://github.com/settings/tokens 。Generate new token,勾选所有权限。

图8

14、编辑远端 URL:https://github.com/shuijingwan/hello_laravel.git ,修改为:https://xxx@github.com/shuijingwan/hello_laravel.git 。删除目录:.git,重新提交与推送。推送成功。如图9
编辑远端 URL:https://github.com/shuijingwan/hello_laravel.git ,修改为:https://xxx@github.com/shuijingwan/hello_laravel.git 。删除目录:.git,重新提交与推送。推送成功。

图9



PS E:\wwwroot\Laravel-8> git branch -M main
PS E:\wwwroot\Laravel-8> git remote add origin https://xxx@github.com/shuijingwan/hello_laravel.git
PS E:\wwwroot\Laravel-8> git push -u origin main
Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 4 threads
Compressing objects: 100% (91/91), done.
Writing objects: 100% (110/110), 68.51 KiB | 1.16 MiB/s, done.
Total 110 (delta 7), reused 0 (delta 0)
remote: Resolving deltas: 100% (7/7), done.
To https://github.com/shuijingwan/hello_laravel.git
 * [new branch]      main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
PS E:\wwwroot\Laravel-8>Git Bash


15、查看 GitHub 上的 Git 仓库,确认文件已经成功推送至 GitHub。如图10
查看 GitHub 上的 Git 仓库,确认文件已经成功推送至 GitHub。

图10

]]>
https://www.shuijingwanwq.com/2021/12/20/5525/feed/ 0