應用場景:
只想將當前文件夾中改動的文件打包成一個patch,並不想提交相應的代碼
執行命令:
git diff nova/api/openstack/compute/servers.py nova/cmd/api.py nova/compute/manager.py nova/conductor/manager.py nova/scheduler/manager.py nova/virt/libvirt/driver.py > debug.log
將改動的文件打包成debug.log文件,就是將輸出重新定向到debug.log文件中
當再次用這個patch的時候,執行命令
git apply debug.log即可