git patch

前端之家收集整理的这篇文章主要介绍了git patch前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在一次尚未commit的代码中,

git diff > test.patch

patch文件可以被放在任何地方
文件恢复到初始状态

git checkout .

应用patch

git apply test.patch

patch有什么用?

Reference

猜你在找的Git相关文章