1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00

git-apply: add page (#4252)

* git-apply: add page

* Apply suggestions from code review

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
This commit is contained in:
Axel Navarro 2020-08-11 20:33:53 -03:00 committed by GitHub
parent fe23465c18
commit daa21a60a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

28
pages/common/git-apply.md Normal file
View file

@ -0,0 +1,28 @@
# git apply
> Apply a patch to files and/or to the index.
> More information: <https://git-scm.com/docs/git-apply>.
- 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 modifying the working tree:
`git apply --cache {{path/to/file}}`