2018-09-25 07:47:56 +01:00
|
|
|
# git am
|
|
|
|
|
2023-04-08 10:44:32 +01:00
|
|
|
> Apply patch files and create a commit. Useful when receiving commits via email.
|
2018-09-25 07:47:56 +01:00
|
|
|
> See also `git format-patch`, which can generate patch files.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://git-scm.com/docs/git-am>.
|
2018-09-25 07:47:56 +01:00
|
|
|
|
2023-04-08 10:44:32 +01:00
|
|
|
- Apply and commit changes following a local patch file:
|
2018-09-25 07:47:56 +01:00
|
|
|
|
|
|
|
`git am {{path/to/file.patch}}`
|
|
|
|
|
2023-04-08 10:44:32 +01:00
|
|
|
- Apply and commit changes following a remote patch file:
|
|
|
|
|
|
|
|
`curl -L {{https://example.com/file.patch}} | git apply`
|
|
|
|
|
2018-09-25 07:47:56 +01:00
|
|
|
- Abort the process of applying a patch file:
|
|
|
|
|
|
|
|
`git am --abort`
|
|
|
|
|
|
|
|
- Apply as much of a patch file as possible, saving failed hunks to reject files:
|
|
|
|
|
|
|
|
`git am --reject {{path/to/file.patch}}`
|