rogerxu / git-tips

Tips for Git
Apache License 2.0
2 stars 3 forks source link

Patch #26

Open rogerxu opened 7 years ago

rogerxu commented 7 years ago

Patches — GitExtensions 2.49.03 documentation

rogerxu commented 7 years ago

Create patch

Git - git-format-patch Documentation

Generate one patch for last commit

$ git format-patch -1

Generate patches base from master

$ git format-patch master

Generate one patch file base from master

$ git format-patch master --stdout > new-feature.patch
rogerxu commented 7 years ago

Apply patches

Git - git-apply Documentation

Instead of applying the patch, output diffstat for the input.

$ git apply --stat abc.patch

Instead of applying the patch, see if the patch is applicable to the current working tree and/or the index file and detects errors.

$ git apply --check abc.patch

Apply patches

$ git apply abc.patch