Git-安装和配置
Git-安装和配置
环境:
- Windows 10
安装Git
- 从官网http://www.git-scm.com/download/,下载Git安装包
- 一路Next
- 询问使用何种命令行工具时,选择
Use Git from Git Bash only
- 将
git/bin
添加进环境变量
配置Git
-
配置
user_name
和user_email
1
2git config --global user.name "用户名"
git config --global user.email "邮箱" -
生成git的公钥和私钥,会将你的
rsa key
生成到目录C:/Users/用户名/.ssh/id_rsa
1 | ssh-keygen -t rsa -C "邮箱" |
-
将公钥添加到github账号中
-
settings
->SSH and GPG keys
->New SSH key
->将刚才生成的id_rsa.pub
粘进去 -
进行测试
1
2ssh -T git@github.com
# 并且输入yes回车
-
Comment