Github免密碼配置

SSH:

ssh-keygen -t rsa -C "abc@example.com"

-t type: rsa1(SSH1),dsa(SSH2),ecdsa(SSH2),rsa(SSH2) etc.

-C comment: 註解

-b bits: Key長度,單位bit, 可用2048或4096等

-f filename key文件名

生成後位於 ~/.ssh

如果改變了key的名稱,需要向ssh agent註冊key:

eval "$(ssh-agent -s)" 或 eval ssh-agent -s
ssh-add <private-ssh-key-file-name>

Github

Setting->SSH and GPG keys,clink new SSH key

Title: 填任意字,最好容易分別的

Key: 複製.pub文件內容並貼上

HTTPS:

$ touch ~/.git-credentials

新增內容

https://{username}:{passwd}@github.com

增加git configure

$ git config --global credential.helper store

查看configure文件

~/.gitconfig