Windows端
初始化
下载Git,在任意文件夹右键菜单打开git bash,输入以下内容完成配置:
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
和GitHub连接
让我们来问问聪明的ChatGPT怎么说吧:
You
git怎么生成ssh,怎么和GitHub连接
ChatGPT
Generate SSH key:
Runssh-keygen -t rsa -b 4096 -C "your email@example.com"
in the terminal
Enter a directory to save the key and a password (or leave empty if desired)
Add SSH key to GitHub account:
Copy the contents of your key withcat ~/.ssh/id_rsa.pub
to clipboardGo to GitHub account settings, select SSHKeys and add a new one with copiedcontents and a label.Test connection to GitHub by runningssh -T git@github.com
.