Patches

It's already mentioned here ( modify local repository and create a patch ) how to create a patch.

how to create a patch
git format-patch -M -C -s --keep-subject -o 2009_07_16-0001-to_amou  e.g. git format-patch -M -C -s --keep-subject -o 2009_07_16-0001-to_amou origin git tag -f 2009_07_16-0001-to_amou
 * 1) hack, commit, hack, commit,...

branch
In any case always create a branch!

git checkout -b  or

git -b  git checkout 

check if it's a valid patch
git apply --reject --whitespace=fix --stat my-patches/rber/koukou/0001-permission-changes.patch git apply --reject --whitespace=fix --check my-patches/rber/koukou/0001-permission-changes.patch

if it's a valid patch
git am --signoff < my-patches/rber/koukou/0001-permission-changes.patch

Note that this also does the commit, git status, git commit will not show any change To see the last commit (done by am) do:

git diff HEAD^

merge to main branch
git checkout master git merge 

tag
git tag 

push
git push origin master git push --tags

this will destroy the author and signed-off info - don't use it! git apply --reject --whitespace=fix my-patches/rber/koukou/0001-permission-changes.patch

how to apply a series of patches from a mailbox
git am 

how to apply a diff/patch style patch
If you get a non-git patch you might have fun applyin it;) I got from a chipset manufacturer a patch, which looks like which was not generated with git, but perversely enough their instructions tell to use git to apply the patch. git apply --binary As expected this did not really work out of the box, since they somehow expected a .gitconfig file, I did not have.

Qt_to_Lamda.patch:1049: space before tab in indent. char *p; Qt_to_Lamda.patch:1052: space before tab in indent. sz=(sizeof(RenderArenaDebugHeader)+127) & (~127); Checking patch .gitignore... error: .gitignore: No such file or directory ...

The obvious solution was: git apply -v --binary -p1 --exclude .gitignore