1. 配置Git用戶名和郵箱
git config user.name "用戶名"
git config user.email "郵箱"
需要修改時
git config --global user.name "用戶名"
git config --global user.email "郵箱"
查詢 Git 本地配置
git config --global -l
2. 生成ssh key
ssh-keygen -t rsa -C "郵箱"
如果報 fatal: not in a git directory, 是因為沒有將當前目錄作為git目錄。
先執行命令 git init 。再執行上面的
如果使用的是GitLab, 將 生成的id_rsa 復制到 settings 的ssh 中就可以了