# Git 的安装与配置

# 1. Git 的安装

官网下载 (opens new window)

# 2. Git 的配置

在使用 git 之前需要使用 config 命令配置下用户名和用户邮箱:

git config --global user.name "<用户名>"
git config --global user.email "<邮箱>"
git config --global push.default simple
git config --global core.editor notepad

在使用 git 之前创建 SSH Key,未来会使用到:

ssh-keygen -t rsa -b 4096 -C "备注"

一路回车

cat ~/.ssh/id_rsa.pub

『备注』通常是 2 种风格:

  • 邮箱

  • username@hostname,例如:tom@192.172.0.110

sshkey-gen