💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 场景 ### 比较工作区与暂存区 ``` git diff ``` ### 比较暂存区与最新本地版本库 ``` git diff --cached [<path>...] ``` ### 比较工作区与最新本地版本库 ``` git diff HEAD [<path>...] ``` ### 比较工作区与指定commit-id的差异 ``` git diff commit-id [<path>...] ``` ### 比较两个commit-id之间的差异 ``` git diff [<commit-id>] [<commit-id>] ``` ### 使用git diff打补丁 ``` //生成文件 git diff > patch git diff --cached > patch git diff --HEAD > patch git diff Testfile > patch // //将单个文件做成一个单独的补丁 // 应用补丁 git apply --check patch // 如果没有任何输出,那么表示可以顺利接受这个补丁 git apply --reject patch // 将能打的补丁先打上,有冲突的会生成.rej文件