I had a situation where I wanted to always apply a patch to file before sending it to somebody, but I didn’t want to commit those changes to git. So I decided to check how to create and apply a patch, which turns out to be very easy:
diff -Naur original_file changed_file > diff.patch
patch < diff.patch