From 7b57ff951a4c5a36612765c37b0b9e42a3eb105c Mon Sep 17 00:00:00 2001 From: Maximilian Kolb Date: Thu, 16 Jan 2025 14:51:26 +0100 Subject: [PATCH] Explain how to work with patches --- CONTRIBUTING.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 616f78a9b34..b985421c882 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,6 +85,46 @@ We do not capitalize the following terms: * Red Hat subscription manifest * subscription +## Working with patches + +You can create patches to simplify sharing proposed changes compared to comments and suggestions on GitHub. + +### Creating patches + +1. Fetch the PR from GitHub: + + $ git fetch upstream pull/1234/head:pr_1234_optional_description + +2. Make your changes and commit them: + + $ vim guides/common/modules/X + $ git add guides/common/modules/X + $ git commit -m "Proposed patch" + +3. View the patch: + + $ git show + +4. Email that patch or post it on GitHub. + +### Applying patches + +1. Store the patch in your `foreman-documentation` repository. +2. Apply the patch: + + $ git apply proposed.patch + +3. Delete the file: + + $ rm proposed.patch + +4. Commit the patch to your branch: + + $ git add guides/common/modules/X + $ git commit -m "Proposed patch" + + To be extra nice, credit the person that provided the patch in the commit message. + ## Further Information * [Contributing Guidelines for Github documentation](https://github.com/github/docs/blob/main/CONTRIBUTING.md)