From a3c102c9a688494a1e71d01cdc4e3140b76eb47b Mon Sep 17 00:00:00 2001 From: mikerambil Date: Thu, 10 Jul 2025 22:20:36 -0500 Subject: [PATCH 1/2] feat: add example for `git request-pull` in toc-source.json to enhance documentation clarity --- toc-source.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toc-source.json b/toc-source.json index a7bbb88..67a0019 100644 --- a/toc-source.json +++ b/toc-source.json @@ -56,6 +56,10 @@ "long_description": "`git request-pull` generates a summary message describing the changes between two commits, which you can send to a project maintainer to request that they pull your changes. This is especially useful for email-based workflows or when collaborating outside of platforms like GitHub. The command outputs a message that includes a comparison summary, a list of commits, and their messages, making it easy for maintainers to review and apply your changes.", "command": "git request-pull ", "examples": [ + { + "code": "git request-pull main https://github.com/example/repo.git feature-branch", + "description": "Generates a summary like:\n\nThe following changes since commit 1234567... (main):\n\n Some previous commit message\n\nare available in the Git repository at:\n\n https://github.com/example/repo.git feature-branch\n\nfor you to fetch changes up to 89abcde... (feature-branch):\n\n New feature commit message\n Another commit message\n\n----------------------------------------------------------------\n file1.txt | 10 ++++++++++\n file2.js | 5 +++++\n 2 files changed, 15 insertions(+)" + }, { "code": "git request-pull v1.0 https://github.com/example/repo.git v1.1", "description": "Generate a pull request message from v1.0 to v1.1." From c25a53d06f3b084ee84fb65dfa197cb306f8be4d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Jul 2025 03:20:50 +0000 Subject: [PATCH 2/2] chore: auto-generate README.md from toc-source.json --- ...ocal-branches-whose-remote-is-gone-bash.md | 2 ++ ...ranches-whose-remote-is-gone-powershell.md | 2 ++ contents/git-maintenance-start.md | 10 +++++- contents/git-request-pull.md | 35 +++++++++++++++++-- contents/patch-vs-diff-quick-reference.md | 5 +++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/contents/delete-local-branches-whose-remote-is-gone-bash.md b/contents/delete-local-branches-whose-remote-is-gone-bash.md index 85ac787..da871b0 100644 --- a/contents/delete-local-branches-whose-remote-is-gone-bash.md +++ b/contents/delete-local-branches-whose-remote-is-gone-bash.md @@ -6,6 +6,8 @@ ![Category: Branch Management](https://img.shields.io/badge/Category-Branch%20Management-blue) > Delete all local branches whose remote counterpart has been deleted, using Bash. +This command fetches the latest remote info and deletes all local branches whose remote tracking branch no longer exists (marked as 'gone'). Useful for cleaning up after remote branch deletions. + #### Command ```sh diff --git a/contents/delete-local-branches-whose-remote-is-gone-powershell.md b/contents/delete-local-branches-whose-remote-is-gone-powershell.md index a68e951..61496fb 100644 --- a/contents/delete-local-branches-whose-remote-is-gone-powershell.md +++ b/contents/delete-local-branches-whose-remote-is-gone-powershell.md @@ -8,6 +8,8 @@ ![Category: Branch Management](https://img.shields.io/badge/Category-Branch%20Management-blue) > Delete all local branches whose remote counterpart has been deleted, using PowerShell. +This script fetches the latest remote info and deletes all local branches whose remote tracking branch no longer exists (marked as 'gone'). Useful for cleaning up after remote branch deletions. + #### Command ```sh diff --git a/contents/git-maintenance-start.md b/contents/git-maintenance-start.md index 9bd1fff..eecbedb 100644 --- a/contents/git-maintenance-start.md +++ b/contents/git-maintenance-start.md @@ -6,6 +6,8 @@ ![Category: Maintenance](https://img.shields.io/badge/Category-Maintenance-blue) > Runs a cronJob in background for the specified repo for periodic maintenance. +`git maintenance start` enables background maintenance tasks for your Git repository. It sets up scheduled jobs (using your system’s scheduler, like cron on Unix or Task Scheduler on Windows) to automatically run Git maintenance commands at regular intervals. This keeps your repository fast and healthy by running tasks like garbage collection, commit-graph optimization, and cleanup operations in the background, so you don’t have to remember to do it manually. + #### Command ```sh @@ -29,15 +31,21 @@ git maintenance start --schedule=hourly #### Steps 1. Run `git maintenance start` in your repository. +2. Optionally, use `--schedule=hourly` or `--schedule=daily` to control how often maintenance runs. +3. `Git will now automatically run tasks like garbage collection, pruning unreachable objects, and optimizing internal data structures in the background`. +4. You can stop background maintenance with `git maintenance stop` if needed. #### ProTips > [!TIP] -> Set up maintenance on large repos to keep them fast. +> Set up maintenance on large or long-lived repos to keep them fast and healthy. > [!TIP] > Use with cron or scheduled tasks for automation. +> [!TIP] +> If you notice Git getting slow, check if maintenance is enabled or run it manually. + #### Links diff --git a/contents/git-request-pull.md b/contents/git-request-pull.md index 3991b11..cc0fb83 100644 --- a/contents/git-request-pull.md +++ b/contents/git-request-pull.md @@ -8,6 +8,8 @@ ![Category: Collaboration](https://img.shields.io/badge/Category-Collaboration-blue) > Generate a request to pull changes into a repository. +`git request-pull` generates a summary message describing the changes between two commits, which you can send to a project maintainer to request that they pull your changes. This is especially useful for email-based workflows or when collaborating outside of platforms like GitHub. The command outputs a message that includes a comparison summary, a list of commits, and their messages, making it easy for maintainers to review and apply your changes. + #### Command ```sh @@ -15,6 +17,30 @@ git request-pull ``` #### Examples +- **Generates a summary like: + +The following changes since commit 1234567... (main): + + Some previous commit message + +are available in the Git repository at: + + https://github.com/example/repo.git feature-branch + +for you to fetch changes up to 89abcde... (feature-branch): + + New feature commit message + Another commit message + +---------------------------------------------------------------- + file1.txt | 10 ++++++++++ + file2.js | 5 +++++ + 2 files changed, 15 insertions(+)** + + +```sh +git request-pull main https://github.com/example/repo.git feature-branch +``` - **Generate a pull request message from v1.0 to v1.1.** @@ -30,16 +56,21 @@ git request-pull main https://github.com/example/repo.git feature-branch #### Steps -1. Run `git request-pull ` to generate a pull request message. +1. Identify the base commit or branch you want to compare from (e.g., main or v1.0). +2. Run `git request-pull ` to generate a pull request message. +3. Send the generated message to the project maintainer (e.g., via email or chat). #### ProTips > [!TIP] -> Use request-pull to generate a summary for code reviews. +> Use this command when collaborating via email or outside of web-based platforms. > [!TIP] > Include a clear start and end point for clarity. +> [!TIP] +> Review the generated message before sending to ensure it accurately describes your changes. + #### Links diff --git a/contents/patch-vs-diff-quick-reference.md b/contents/patch-vs-diff-quick-reference.md index 03b3cdc..44282f7 100644 --- a/contents/patch-vs-diff-quick-reference.md +++ b/contents/patch-vs-diff-quick-reference.md @@ -6,6 +6,11 @@ ![Category: Patch & Diff](https://img.shields.io/badge/Category-Patch%20%26%20Diff-blue) +| Command | Use Case | Preserves Commit Info? | Can Apply With | +|---|---|---|---| +| git diff > file.diff | Share uncommitted changes | ❌ | git apply | +| git format-patch > file.patch | Share committed changes | ✅ | git am | + ---