git命令
查看所有信息
git config --list
配置用户信息
git config --global user.name correns //设置用户名
git config --global user.emal lpbeijing //设计邮箱名称
如果存在配置错误例如
user.ame=lpbeijing@163.com
执行后删除
git config --global --unset user.ame
配置github信息认证信息
bogon:react localhost$ ssh-keygen -t rsa -C 'lpbeijing@163.com'
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/localhost/.ssh/id_rsa):
/Users/localhost/.ssh/id_rsa already exists.
Overwrite (y/n)? n
bogon:react localhost$ ls /Users/localhost/.ssh/id_rsa.pub
/Users/localhost/.ssh/id_rsa.pub
在github网上新增ssh key中填写刚刚生成的文件id_rsa.pub中的内容
验证
bogon:react localhost$ ssh -T git@github.com
Hi Correns! You've successfully authenticated, but GitHub does not provide shell access.
获取地址
下载github上的代码
bogon:react localhost$ git clone git@github.com:Correns/imoocmanager.git
Cloning into 'imoocmanager'...
remote: Enumerating objects: 283, done.
remote: Counting objects: 100% (283/283), done.
remote: Compressing objects: 100% (196/196), done.
remote: Total 283 (delta 60), reused 273 (delta 50), pack-reused 0
Receiving objects: 100% (283/283), 13.35 MiB | 47.00 KiB/s, done.
Resolving deltas: 100% (60/60), done.
然后在本地修改代码之后提交
git add .
git commint -m 'add prettier rules'
git push origin
就可以在github上看到最新提交的代码
git push之后
好记性不如烂笔头,多多记录自己需要的才能记牢












网友评论