git-am, git-apply: add and tweak remote patch examples (#10019)

`curl` now uses the `-L` option to follow redirects, which is required
when applying patch files from GitHub URLs. The example was also added
to `git-am` where it works too.

The difference between `git-am` and `git-apply` was also clarified in each
command's description.
This commit is contained in:
Hugo Locurcio
2023-04-08 11:44:32 +02:00
committed by GitHub
parent 3e3230b8c3
commit 401f0388c3
2 changed files with 9 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
# git apply
> Apply a patch to files and/or to the index.
> Apply a patch to files and/or to the index without creating a commit.
> See also `git am`, which applies a patch and also creates a commit.
> More information: <https://git-scm.com/docs/git-apply>.
- Print messages about the patched files:
@@ -13,7 +14,7 @@
- Apply a remote patch file:
`curl {{https://example.com/file.patch}} | git apply`
`curl -L {{https://example.com/file.patch}} | git apply`
- Output diffstat for the input and apply the patch: