---
title: "CreatePatch"
id: "4448"
type: "page"
slug: "createpatch"
published_at: "2026-05-13T02:04:33+00:00"
modified_at: "2026-05-13T17:08:02+00:00"
url: "https://ubuntustudio.org/ubuntustudio/createpatch/"
markdown_url: "https://ubuntustudio.org/ubuntustudio/createpatch.md"
excerpt: "UbuntuStudio/CreatePatch – Ubuntu Wiki Source: https://wiki.ubuntu.com/UbuntuStudio/CreatePatch CreatePatch UbuntuStudio /UbuntuStudio UbuntuStudio/Community Home Testing PR & Support Artwork Packaging/Development Documentation Organization Home Testing PR & Support Artwork Packaging/Development Documentation Organization — Developer Side Bar — ( Edit ) Team Pages – Bugs..."
---

# UbuntuStudio/CreatePatch – Ubuntu Wiki

Source: [https://wiki.ubuntu.com/UbuntuStudio/CreatePatch](https://wiki.ubuntu.com/UbuntuStudio/CreatePatch)

## [CreatePatch](CreatePatch)

[UbuntuStudio](../../../../../help)

[/UbuntuStudio](index)

[UbuntuStudio/Community](../../../../../help/content/community/UbuntuStudio--Community)

| Home | Testing | PR & Support | Artwork | Packaging/Development | Documentation | Organization |
| --- | --- | --- | --- | --- | --- | --- |

**[Home](index)**

**[Testing](Testing)**

**[PR & Support](PublicRelationsDocumentation)**

**[Artwork](Artwork)**

**[Packaging/Development](Development)**

**[Documentation](Documentation)**

**[Organization](Organization)**

| — Developer Side Bar — ( Edit ) Team Pages – Bugs Team – Contributor Team – Core Team – Dev Team – Kernel Team – Release Team – Testing Team Ubuntu Studio Policy – Project Lead Vote UbuntuStudio/Packaging Needs Packaging Developer Documentation – Setup Dev Environment – Bzr Cheat Sheet – Bug Management – Packaging — Ubuntu Studio Package Maintenance — Uploading Packages (to the archive) – Backports – Stable Release Updates (SRU) – Seed Management – Uploading to PPA – Applying Patches – Deb Diff – Setup Local ISO Build Server – All About ISOs – Kernel Maintenance – Ubiquity – the live installer Developer Tutorials – Simple bug fix example using ‘git’, ‘bzr’ and ‘edit-patch’ Workflows – Audio – Video – Graphics – Photography – Publishing Workflow Categories Freedesktop Categories Deb Tags Ubuntu Studio Packages Ubuntu Studio Launchpad Projects Reference – Terminology |
| --- |

**— [Developer](Development)
 Side Bar — ([Edit](Navigation/DevSideBar)
)** **Team Pages** – [Bugs Team](UbuntuStudioBugsTeamPage)
 – [Contributor Team](ContributorTeamPage)
 – [Core Team](CoreTeamPage)
 – [Dev Team](DevTeamPage)
 – [Kernel Team](KernelTeamPage)
 – [Release Team](ReleaseTeamPage)
 – [Testing Team](TestingTeamPage)
 **[Ubuntu Studio Policy](Policy)** – [Project Lead Vote](ProjectLeadVote)
 **[UbuntuStudio/Packaging](Packaging)** [Needs Packaging](NeedsPackaging)
 **[Developer Documentation](DeveloperDocumentation)** – [Setup Dev Environment](SetupDeveloperEnvironment)
 – [Bzr Cheat Sheet](Bzr)
 – [Bug Management](BugManagement)
 – [Packaging](Packaging)
 — [Ubuntu Studio Package Maintenance](Packaging/UploadingPackages)
 — [Uploading Packages (to the archive)](Packaging/UploadingPackages)
 – [Backports](Backports)
 – [Stable Release Updates (SRU)](StableReleaseUpdates)
 – [Seed Management](PackageSelectionDevelopment)
 – [Uploading to PPA](Packaging/UploadingPackages)
 – [Applying Patches](PatchingSourcePackages)
 – [Deb Diff](DebDiff)
 – [Setup Local ISO Build Server](SetupLocalIsoBuildServer)
 – [All About ISOs](AllAboutISOs)
 – [Kernel Maintenance](KernelMaintenance)
 – [Ubiquity – the live installer](Ubiquity)
 **[Developer Tutorials](DeveloperTutorials)** – [Simple bug fix example using ‘git’, ‘bzr’ and ‘edit-patch’](DeveloperTutorials/SimpleBugFixExample)
 **[Workflows](Workflows)** – [Audio](Workflows/Audio)
 – [Video](Workflows/Video)
 – [Graphics](Workflows/Graphics)
 – [Photography](Workflows/Photography)
 – [Publishing](Workflows/Publishing)
 **[Workflow Categories](WorkflowCategories)** **[Freedesktop Categories](FreedesktopCategories)** **[Deb Tags](Debtags)** **[Ubuntu Studio Packages](UbuntuStudioPackages)** **[Ubuntu Studio Launchpad Projects](LaunchpadProjects)** **Reference** – [Terminology](Terminology)

# Creating a Patch

A patch is really just a textfile which contains a collection of lines to be added or substracted to/from other textfiles.

## Create Patch From a git Cherry Pick

[git](http://en.wikipedia.org/wiki/Git_%28software%29)
 is a source code management tool, which is becoming more and more popular. Creating a patch from a git repo is quite easy, if you know which commit(s) you are looking for.

If you know which commit includes the changes you are interested of, for instance *886600b5a2baa0c88f4d709dbc6ab0896e6565cb*, in the root of the git source, do:

| git show 886600b5a2baa0c88f4d709dbc6ab0896e6565cb |
| --- |

git show 886600b5a2baa0c88f4d709dbc6ab0896e6565cb

The result could look something like this:

```
   1

commit 886600b5a2baa0c88f4d709dbc6ab0896e6565cb

   2

Author: Kaj Ailomaa <zequence@mousike.me>

   3

Date:   Mon Mar 18 22:15:05 2013 +0100

   4

   5

    added a few lines to a README

   6

   7

diff --git a/README b/README

   8

index e69de29..4a2b88c 100644

   9

--- a/README

  10

+++ b/README

  11

@@ -0,0 +1 @@

  12

+Adding a few lines to this README

  13
```

It contains most of the info we need for patching a Debian source package. It has the actual diff that will change the source code. It also includes the author of the commit, as well as a description of the commit. All this can be used when documenting the patch.

If we were to create a patch from this, all we need to do is:

```
git show 886600b5a2baa0c88f4d709dbc6ab0896e6565cb > ../my-fix.patch
```

# Applying a patch

Applying a patch is generally done by entering the root of the source directory. Then, using the command:

```
patch -p 1 < /path/to/patch
```

See the man page for patch to learn more.

UbuntuStudio/CreatePatch (last edited 2013-03-18 22:37:46 by h-4-180)
