Git is an amazing tool. It’s super useful for so many things. In this article I am going to describe how to create and apply patches using “git diff”..
We can easily create patches using “git diff”
git diff --no-prefix > newpatch
..and patch our sources:
patch -p0 < newpatch
of course we can also apply patches which are made without –no-prefix-options:
patch -p1 < newpatch
Useful configs for working with diff would be: $HOME/.gitconfig:
# for the best editor in the world
[core]
editor = vim
# for colours
[color]
ui = auto