git的配置

2018/07/01 Tools 共 477 字,约 2 分钟

本地配置

git config --global user.email "846897373@qq.com"

(该邮箱地址必须和github上邮箱一样)

git config --global user.name "mafulong"

(名字和github上的用户名一样)

查看命令:

git config -global user.name
git config -global user.email

远程配置

生成密钥

ssh-keygen -t rsa -C "846897373@qq.com"

提交密钥

文件,win10 的在用户目录下的.ssh 下

id_rsa.pub

使用命令(win10 及 linux 公用)

cat ~/.ssh/id_rsa.pub

检验是否链接上 github

ssh git@github.com

result:

PTY allocation request failed on channel 0
Hi mafulong! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Search

    Table of Contents