Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-apply: add page #4252

Merged
merged 2 commits into from
Aug 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pages/common/git-apply.md
Original file line number Diff line number Diff line change
@@ -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`
navarroaxel marked this conversation as resolved.
Show resolved Hide resolved

- 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:
navarroaxel marked this conversation as resolved.
Show resolved Hide resolved

`git apply --cache {{path/to/file}}`