创建分支 git branch ***
切换分支 git checkout ***
创建并切换到新分支 git checkout -b ***
删除分支 git branch -d ***
本地分支关联远程分支 git branch --set-upstream-to=origin/remote_branch your_branch
添加文件至暂存区 git add
提交暂存区文件 git commit -m "description"
以上两部操作可合并为 git commit -am "description"
pull:git pull origin remote_branch:your_branch
push:git push origin your_branch:remote_branch
查看该分支所有操作(commit push pull...) git reflog
回滚至某个版本:先使用git reflog查询某个版本的版本号,eg:e1bdff6 (HEAD -> master) HEAD@{0}: commit: description,然后git reset --hard e1bdff6
创建一个指定某个远程分支的本地分支
git checkout -b new_branch origin/remote_branch