git diff > file.patch
But sometimes it happens that part of the stuff you're doing are new files that are untracked and won't be in your git diff output. So, one way to do a patch is to stage everything for a new commit (but don't do the commit), and then:
git diff --cached > file.patch
Add the 'binary' option if you want to add binary files to the patch (e.g. mp3 files):
git diff --cached --binary > file.patch
git diff commitid1 commitid2 > file.patch
git diff commitid1 > file.patch
diff -u path/to/original_file path/to/new/modified_file > file.patch
git stash show -p > file.patch
git apply mypatch.patch