常用命令:
- git clone {远程url地址} :从远端克隆到本地
- git log :查看提交日志
- git status :查看状态
- git branch :查看当前分支
- git branch –a :查看所有分支
- git checkout -b {分支名} { origin/feature/分支名} :切换分支
- git remote –v :查看url地址
- git fetch origin :抓取远程仓库更新
- git pull :拉取
- git reset --hard HEAD~2 :回滚掉两次提交
- git reset --hard 2e70fdf :回滚到指定commitid
- git push -f :回滚后强行提交到远程仓库
- git add xxx.txt :新增文件
- git commit -m ‘提交注释’ :提交
暂存管理
- git stash :暂存
- git stash list :列出所有stash
- git stash apply :回复暂存的内容
- git stash drop :删除暂存区