Open maurolepore opened 4 years ago
For some nice variation including creating a patch file from git diff > a-file.patch
and git apply a-file.patch
(which leaves the changes unstaged) see https://nithinbekal.com/posts/git-patch/
For historical context, before GitHub and friends, git was used mostly locally and commits where shared by emailed. Back then, applying commits from patch files was common.
cc @jdhoffa 👍
Based on https://mijingo.com/blog/creating-and-applying-patch-files-in-git
If
branch-a
has more commits thanbranch-b
, this creates patch files under thepatches
directory where each patch file is a commit missing frombranch-b
.This will create
.patch
files in thepatches/
directory like so:Now, patch files can be emailed, and each applied anywhere like so: