安装
sudo apt-get install git
配置
git config --global user.name "git注册的用户名"
git config --global user.email "git注册的邮箱"
生成密钥
ssh-keygen -t rsa -C "git注册的邮箱"
提示输入密码
GitHub上添加公有密钥
github上操作:
登陆GitHub官网
点击头像
下拉选择Settings点击进入
右栏选择SSH and GPG keys点击
会出现SSH Keys
Linux系统下操作:
进入.ssh下面会有三个文件
id_rsa id_rsa.pub know_hosts
cat id_rsa.pub
会出现一串公钥
github上操作:
点击New SSH key添加到github(注意后面的邮箱要删掉)
验证密钥是否通过
ssh -T git@github.com
测试
git clone https://github.com/...
git status 查看状态
git add 状态的连接选择要提交的修改文件(git add . 为全部提交)
git commit -m "说明" (git commit -a 为提交全部,可省略git add)
git push 上推
git pull 下拉
github被微软收购啦~

网友评论