GIT CHEAT SHEET GIT作弊表
CREATE 创建
Clone an existing repository
复制一个存在的仓库
$ git clone ssh://user@domain.com/repo.git
使用ssh协议生成密钥
ssh-keygen -t rsa -C "<your email address>"
cd ~/.ssh
subl id_rsa.pub
Create a new local repository
创建一个新的本地仓库
$ git init
设置用户名和邮箱
$ git config --global user.name "<user name>"
$ git config --global user.email <email for github>
LOCAL CHANGES 本地库修改
Changed files in your working directory
查看工作目录下文件的修改状态
$ git status
Changes to tracked files
查看文件的修改情况
$ git diff
Add all current changes to the next commit
添加文件
$ git add <file> #(添加文件)
Add some changes in to the next commit
提交文件
$ git commit -m "<message>" #(提交文件)
-m: add commit messege
Commit all local changes in tracked files
添加所有更改到提交序列
$ git add .
Commit previously staged changes
对文件添加一些修改并发送到提交序列。 [wait-for][?]
$ git add -p <file>
Commit all local changes in tracked files
提交更改(所有文件?)
$ git commit -a
Commit previously staged changes
提交更改(前边的文件)
$ git commit