From b3f536d7d31555e2d16538ad268f205810b1f9a2 Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Thu, 6 Aug 2020 16:54:19 -0300 Subject: [PATCH 1/2] git-apply: add page --- pages/common/git-apply.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/git-apply.md diff --git a/pages/common/git-apply.md b/pages/common/git-apply.md new file mode 100644 index 0000000000000..801368e8f59da --- /dev/null +++ b/pages/common/git-apply.md @@ -0,0 +1,28 @@ +# git apply + +> Apply a patch to files and/or to the index. +> More information: . + +- Print messages about the patched files: + +`git apply --verbose {{path/to/file}}` + +- Apply and add the patched files to the index: + +`git apply --index {{path/to/file}}` + +- Apply a remote patch file: + +`curl https://example.com/file.patch | git apply` + +- Output diffstat for the input and apply the patch: + +`git apply --stat --apply {{path/to/file}}` + +- Apply the patch in reverse: + +`git apply --reverse {{path/to/file}}` + +- Store the patch result in the index without modify the working tree: + +`git apply --cache {{path/to/file}}` From 0369d2dd2881871fb7dd9619faec9d9b21fb9f96 Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Sun, 9 Aug 2020 21:19:08 -0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Starbeamrainbowlabs --- pages/common/git-apply.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/git-apply.md b/pages/common/git-apply.md index 801368e8f59da..5b5757916c376 100644 --- a/pages/common/git-apply.md +++ b/pages/common/git-apply.md @@ -13,7 +13,7 @@ - Apply a remote patch file: -`curl https://example.com/file.patch | git apply` +`curl {{https://example.com/file.patch}} | git apply` - Output diffstat for the input and apply the patch: @@ -23,6 +23,6 @@ `git apply --reverse {{path/to/file}}` -- Store the patch result in the index without modify the working tree: +- Store the patch result in the index without modifying the working tree: `git apply --cache {{path/to/file}}`