git 安装及设置 (Windows)
-
下载Windows版本git: 例如 Git-2.24.1.2-64-bit.exe
https://git-scm.com/download/win -
执行 Git-2.24.1.2-64-bit.exe 安装 git.
-
第一次执行 需要 配置 git
cd /c/Users//.ssh 路径;
执行 ssh-keygen:$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xzhao1/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xzhao1/.ssh/id_rsa.
Your public key has been saved in /c/Users/xzhao1/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:G2YLsJMF0RZKWMR41JO3xUfdfXoD4An0CPTSiY9ECaw xzhao1@PA008489N1
The key’s randomart image is:
±–[RSA 3072]----+
| BO=+o+ oo. …|
| o.o+B. O o… +|
| .+…* B = …|
| E =. = …|
| + …S. …|
| . + + |
| o |
| |
| |
±—[SHA256]-----+
$ ls
id_rsa id_rsa.pub known_hosts
$cat id_rsa.pub
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDbz41j5D1Bz9Te0FFQwpaYAr/aA1gc3ky8O7D/OAZerXbeymKRcaWlImOnav/YTdiGnmU5ryan8b3UjwmZ5jKk5jIP41NPYpqc1WmxnehNefKcJ2I3c2+mlCGfpNRp46VN1qhVDErm+N02Y1/qWvumP7adTir+zNU3SZC0yHOlfWLyO0gpjM1JfYrEmhsJPsynwQ9aoxp74fWTtfw6Pb0302vQzLPKJFE2oy/0/mXw2CrCbvkqOHyLKiJASJidQACulL426MRacpxolOvvYaW0RnArgs3rrfXdSpmH/0XAfQPBVSDpb6HPRascigNeziWNUGx5IRUnM7g18Qa0nUxKcyWkwryVhdvafikhW2Ch+hmpsmGZhtaCgkQcCAilXltXwd6dlaW3W2wVMGxKIkLNE627v/Eto+UhXcIS5X0WIr891wWl68L43Xml8OqbhQMzb7U73lDGENldKmr2Mw5lW591odS+Q6/d6nhCsON4+5s4KZwkicy+CANg8KfxAYU= xzhao1@PA008489N1
把上边的公钥添加到你的网站的账号公钥里.
git config --global user.name “xzhao1”
git config --global user.email [email protected]
这样git就可以正常工作了。