- 有新代码提交后文件冲突,不能pull代码,Git不能像SVN那样自动Merge,可:
- git stash
 - git pull
 - git stash pop
 
 - 比较两个commit之前的修改,生成patch文件并apply到其它地方:
- git diff {较早commit hash} {较新commit hash} > MyPatch.diff
 - git apply MyPatch.diff
 
 - 从其它分支提取某一个提交并apply到当前分支:
- git cherry pick {某次commit hash}
 
 - git reset [<mode>] [<commit>]
- mode:
- –hard 放弃本地修改, 重置所有文件状态和修改内容
 - –mixed 重置所有文件状态, 保留文件内容
 - –soft 保留本地文件状态和内容
 
 - commit commit hash, HEAD, origin/<branch name>
 
 - mode: