# How do I split changes into separate patches?

**URL:** <https://discourse.pijul.org/t/how-do-i-split-changes-into-separate-patches/618>\
**Category:** Question\
**Created:** [November 24, 2020, 1:12am UTC](https://discourse.pijul.org/t/how-do-i-split-changes-into-separate-patches/618 "2020-11-24T01:12:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![porglezomp](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@porglezomp](https://discourse.pijul.org/u/porglezomp)\
**Post date:** [November 24, 2020, 1:12am UTC](https://discourse.pijul.org/t/how-do-i-split-changes-into-separate-patches/618/1 "2020-11-24T01:12:54Z")

</div>

Hello! I’m excited about using Pijul and I’m trying it out on some for-fun personal projects, and I’ve run into the trouble that I don’t know how to make patches that follow logical changes, when my personal development process is definitely more messy than that.

With git I would usually stash changes and then make multiple commits, although recently I’ve been looking at using [https://blog.aloni.org/posts/gitology-1-git-flip-history/](https://blog.aloni.org/posts/gitology-1-git-flip-history/) which seems like a good solution for this “untangling multiple changes” workflow. I’m not sure how to do this with Pijul though, where I don’t see as clear of a path.

How do I untangle my work into multiple clean patches?

---

<div class="post-metadata">

**Author:** ![pmeunier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pmeunier/32/4_2.png) [@pmeunier](https://discourse.pijul.org/u/pmeunier)\
**Post date:** [November 24, 2020, 7:35am UTC](https://discourse.pijul.org/t/how-do-i-split-changes-into-separate-patches/618/2 "2020-11-24T07:35:20Z")

</div>

By design, there are no dependencies between sections of the patch in text format.

Therefore, you can start by doing `pijul record --amend XYZ` where `XYZ` is a prefix of the hash, remove stuff, and record again.

Or unrecord, record again, and open a few instances of your favourite text editor to cut and paste the result into multiple text patches. Then, you can pipe them into `pijul apply `.

Each of these text files will need a preamble and dependencies. You can safely copy paste the preamble of the original patch given by `pijul record`, since dependencies are recomputed anyway during parsing.

Let me know how that works.
