Git

git init

git add <filename1> <filename2>

git add .

git checkout -- <filename>

git checkout -- .

git status

git config --global user.name <username>

git config --global user.email <email>

git commit -m 'reason'

git log

git reset --hard HEAD^

git reset --hard <version>

git remote add origin <url>

git push -u origin <branch>

git pull

克隆项目到本地 git clone <url>

创建并切换到自己的分支 git branch allen,  git checkout allen 或 git checkout -b allen

在自己的分支上做开发然后实施版本控制 git add . git commit -m 'reason'

将自己的工作合并到master上  git checkout master git merge allen.

不使用fast-forward方式合并(git log中没有分支记录) git merge --no-ff allen -m 'reason'

图形化的方式查看到分支信息 git log --graph --pretty=oneline --abbrev-commit
原文地址:https://www.cnblogs.com/allen2333/p/9225288.html