连接 github 相关

  1. Failed to connect to github.com port 443 解决方案
    参考:https://zhuanlan.zhihu.com/p/670646102
  2. 多个账号切换
    参考:https://worktile.com/kb/ask/224209.html
  3. bash代码
1. **Remove the existing GitHub account from WebStorm:**
- Go to `Preferences` > `Version Control` > `GitHub`.
- Select the existing account and click the `-` button to remove it.
2. **Add multiple GitHub accounts:**
- In the same `Preferences` > `Version Control` > `GitHub` section, click the `+` button.
- Choose `Log In via GitHub` and follow the authentication steps to add each of your GitHub accounts.
3. **Configure SSH keys for each GitHub account:**
- Generate a new SSH key for each GitHub account:
```sh
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```
- Add the SSH key to the corresponding GitHub account:
```sh
ssh-add ~/.ssh/id_rsa
```
- Copy the SSH key to your clipboard:
```sh
pbcopy < ~/.ssh/id_rsa.pub
```
- Add the SSH key to your GitHub account via GitHub's web interface.
4. **Create an SSH config file to manage multiple keys:**
- Edit or create the `~/.ssh/config` file:
```sh
touch ~/.ssh/config
nano ~/.ssh/config
```
- Add the following configuration for each GitHub account:
```sh
Host github.com-ACCOUNT1
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_account1
Host github.com-ACCOUNT2
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_account2
```
5. **Update the remote URL for your repositories:**
- Open the terminal in WebStorm.
- Use the following command to update the remote URL to use the correct SSH configuration:
```sh
git remote set-url origin git@github.com-ACCOUNT1:USERNAME/REPOSITORY_NAME.git
```
6. **Verify the changes:**
- Use the following command to verify the remote URL:
```sh
git remote -v
```
  1. push/pull超时问题
    参考:https://www.cnblogs.com/spriteZzz/p/17227579.html

posted on   朝朝暮Mu  阅读(7)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示