Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

34
git-apply Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git apply
> 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:
`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 -L {{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}}`