Commit 6e51e6d9 authored by Jamie Tanna's avatar Jamie Tanna

Add note about using `git am` to apply the commit message

As I found that was a thing yesterday!
parent cb75b97d
Pipeline #129875819 passed with stage
in 3 minutes and 58 seconds
---
title: "Backporting/Replaying Changes using `git format-patch` and `git apply`"
description: "Using `git format-patch` and `git apply` to apply a patch, if `git cherry-pick` isn't available."
title: "Backporting/Replaying Changes using `git format-patch` and `git apply` / `git-am`"
description: "Using `git format-patch` and `git apply`/`git am` to apply a patch, if `git cherry-pick` isn't available."
tags:
- blogumentation
- git
......@@ -66,4 +66,10 @@ And then we can then feed this file into `git apply`:
$ git apply < patch
```
However, this doesn't quite work when you want to use the commit message, too. For this, we can use `git am`:
```sh
$ git am < patch
```
This _may_ have issues if the patch doesn't apply cleanly, but once resolved, you'll have the commit applied with patch and commit message!
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment