git 目前常用的一些命令整理记录
常用操作记录:
1、git branch ;查看当前分支
2、git status ;查看分支状态
3、git add xxxx/xxx/xxx ; 提交修改过的文件
4、git commit -m “提交描述” ; 提交修改过的文件
5、git checkout xxxx ; 切换分支
6、git log ;查看当前分支提交记录。
7、git checkout -b <new-branch> ; 创建一个和当前分支一样的新分支(在创建前,优先执行上面 2、3、4步骤把修改的都提交完成)
8、git cherry-pick <commit-hash> ; 在当前分支上复制其它分支提交的内容。
9、git diff <分支1> <分支2> ;比较两个分支的差异
10、git diff --stat <source-branch>..<new-branch> ; 统计比较差异
11、git branch -d <branch-name> ; 删除一个分支
12、git branch -D <branch-name> ;强制删除分支(慎用)
13、git add . ;添加所有的变更记录。