I\'ve got eight commits on a branch that I\'d like to email to some people who aren\'t git enlightened, yet. So far, everything I do either gives me 8 patch files, or start
Easiest way is to use git diff
, and add in git log
if you want the combined commit message that the squash method would output. For example, to create the patch between commit abcd
and 1234
:
git diff abcd..1234 > patch.diff
git log abcd..1234 > patchmsg.txt
Then when applying the patch:
git apply patch.diff
git add -A
git reset patch.diff patchmsg.txt
git commit -F patchmsg.txt
Don't forget the --binary
argument to git diff
when dealing with non-text files, e.g. images or videos.
Based on Adam Alexander's answer:
git checkout newlines
## must be rebased to master
git checkout -b temporary
# squash the commits
git rebase -i master
git format-patch master