Git 配置与基本命令

Git 配置与基本命令

社蕙 110 2023-02-07

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:
Run ssh-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 with cat ~/.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 running ssh -T git@github.com .