Guides > Agentic Engineering Patterns > Using Git with coding agents
Changes to Using Git with coding agents
March 23, 2026, 12:47 a.m. #
---
+++
@@ -54,7 +54,10 @@
```markdown-copy
Sort out this git mess for me
```
-I use this universal prompt surprisingly often! There are plenty of ways you can get into a mess with Git, often through pulls or rebase commands that end in a merge conflict, or just through adding the wrong things to Git's staging environment.
+
+I use this universal prompt surprisingly often! Here's [a recent example](https://gisthost.github.io/?2aa2ee2fbd08d272528bbfc3b54a1a7d/page-001.html) where it fixed a cherry-pick for me that failed with a merge conflict.
+
+There are plenty of ways you can get into a mess with Git, often through pulls or rebase commands that end in a merge conflict, or just through adding the wrong things to Git's staging environment.
Unpicking those used to be the most difficult and time consuming parts of working with Git. No more! Coding agents can navigate the most Byzantine of merge conflicts, reasoning through the intent of the new code and figuring out what to keep and how to combine conflicting changes. If your code has automated tests (and [it should](https://simonwillison.net/guides/agentic-engineering-patterns/red-green-tdd/)) the agent can ensure those pass before finalizing that merge.
March 21, 2026, 10:08 p.m. #
Draft status changed from draft to published.
March 21, 2026, 10:08 p.m. #
---
+++
@@ -101,6 +101,7 @@
Remove uv.lock from that last commit
```
You can also perform more finely grained surgery on commits - rewriting them to remove just a single file, for example.
+
```markdown-copy
Combine last three commits with a better commit message
```
March 21, 2026, 10:06 p.m. #
---
+++
@@ -78,7 +78,7 @@
Coding agents can handle this boilerplate for you. This upgrades Git bisect from an occasional use tool to one you can deploy any time you are curious about the historic behavior of your software.
-## Faking or rewriting history
+## Rewriting history
Let's get into the fun advanced stuff.
March 21, 2026, 10:03 p.m. #
Initial version.