git log 查看commit的历史
git show <commit-hash-id>查看某次commit的修改内容
git log -p <filename>查看某个文件的修改历史
git log -p -2查看最近2次的更新内容
git merge 会生成一个新的合并节点,而rebase不会
比如:
1 2 3 |
D---E test / A---B---C---F master |
使用merge合并, 为分支合并自动识别出最佳的同源合并点:
1 2 3 |
D--------E / \ A---B---C---F----G test, master |
而使用rebase则:
1 |
A---B---D---E---C'---F' test, master |
使用git pull时默认是merge, 加 --rebase参数使其使用rebase方式
1 |
git pull --rebase |