ssh-keygen -t rsa -C “email@email.com”(默认保存在/home/user/.ssh/id_rsa.pub)
到github,进入 settings -> SSH and GPG Keys
点击New SSH key,写入Title,粘贴刚刚生成的 SSH keys,点击 Add SSH Key
ssh -T git@github.com
如果出现You’ve successfully authenticated, but GitHub does not provide shell access 表示已成功连上github。如果出现Agent admitted failure to sign using the key.Permission denied (publickey)错误 执行 ssh -add
git config –global user.name “your name” //配置用户名
git config –global user.email “your email” //配置email
git clone 仓库的URL
进入本地仓库 git init(执行一次即可)
git remote add origin git@github.com:用户名/仓库名.git
git add xxx git add .(自动判断)
git commit -m “说明信息”
git push
vim创建文件 .git-credentials:
输入:
https://username:password@github.com
执行:
git config –global credential.helper store