From c10622a82e8c15a47e5fa7a28aceafe9d1a9e020 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Jul 2025 02:33:03 +0000 Subject: [PATCH] chore: auto-generate README.md from toc-source.json --- contents/cleanup-branches-fast.md | 9 +++++++++ .../delete-local-branches-whose-remote-is-gone-bash.md | 9 +++++++++ ...ete-local-branches-whose-remote-is-gone-powershell.md | 9 +++++++++ contents/git-essentials-hidden-gems.md | 9 +++++++++ contents/git-maintenance-start.md | 9 +++++++++ contents/git-request-pull.md | 9 +++++++++ contents/view-and-clean-up-local-git-branches-bash.md | 9 +++++++++ .../view-and-clean-up-local-git-branches-powershell.md | 9 +++++++++ 8 files changed, 72 insertions(+) diff --git a/contents/cleanup-branches-fast.md b/contents/cleanup-branches-fast.md index 986eac6..0333b39 100644 --- a/contents/cleanup-branches-fast.md +++ b/contents/cleanup-branches-fast.md @@ -6,6 +6,15 @@ ![Category: Branch Management](https://img.shields.io/badge/Category-Branch%20Management-blue) > Quickly view and clean up local branches using Bash or PowerShell, including removing branches whose remote is gone. + +#### ProTips +> [!TIP] +> Run 'git fetch -p' before cleaning up branches to update remote info. + +> [!TIP] +> Always double-check which branches will be deleted. + + ## Key Topics & Subcommands - [Delete Local Branches Whose Remote is Gone (Bash)](./delete-local-branches-whose-remote-is-gone-bash.md): Delete all local branches whose remote counterpart has been deleted, using Bash. - [Delete Local Branches Whose Remote is Gone (PowerShell)](./delete-local-branches-whose-remote-is-gone-powershell.md): Delete all local branches whose remote counterpart has been deleted, using PowerShell. 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 2392cf8..2ed7884 100644 --- a/contents/delete-local-branches-whose-remote-is-gone-bash.md +++ b/contents/delete-local-branches-whose-remote-is-gone-bash.md @@ -32,6 +32,15 @@ git fetch -p && git branch -vv | grep '\[origin/.*: gone\]' | awk '{print $1}' | - ⚠️ Make sure you have no unmerged work on these branches. +#### ProTips +> [!TIP] +> Use this after deleting branches on the remote to keep your local repo tidy. + +> [!TIP] +> Add 'echo' before 'git branch -d' to preview what will be deleted. + + + [➡️ See the Next Step: Delete Local Branches Whose Remote is Gone (PowerShell)](./delete-local-branches-whose-remote-is-gone-powershell.md) --- 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 f7b2807..f1a8e61 100644 --- a/contents/delete-local-branches-whose-remote-is-gone-powershell.md +++ b/contents/delete-local-branches-whose-remote-is-gone-powershell.md @@ -36,6 +36,15 @@ git branch -vv | ForEach-Object { if ($_ -match '[.*: gone]') { $parts = $_.Trim - ⚠️ Make sure you have no unmerged work on these branches. +#### ProTips +> [!TIP] +> Great for Windows users to automate branch cleanup. + +> [!TIP] +> Review the list before confirming deletion. + + + [➡️ See the Next Step: View and Clean Up Local Git Branches (Bash)](./view-and-clean-up-local-git-branches-bash.md) --- diff --git a/contents/git-essentials-hidden-gems.md b/contents/git-essentials-hidden-gems.md index af85e1c..f44d5e6 100644 --- a/contents/git-essentials-hidden-gems.md +++ b/contents/git-essentials-hidden-gems.md @@ -8,6 +8,15 @@ A collection of practical, lesser-known, and foundational Git commands that are useful for all users. Start here to discover commands that can improve your workflow and understanding of Git. + +#### ProTips +> [!TIP] +> Try these commands in a test repo before using them on important projects. + +> [!TIP] +> Bookmark this section for quick reference to hidden gems. + + ## Key Topics & Subcommands - [git maintenance start](./git-maintenance-start.md): Runs a cronJob in background for the specified repo for periodic maintenance. - [git request-pull](./git-request-pull.md): Generate a request to pull changes into a repository. diff --git a/contents/git-maintenance-start.md b/contents/git-maintenance-start.md index 3b92c47..aa2cbe3 100644 --- a/contents/git-maintenance-start.md +++ b/contents/git-maintenance-start.md @@ -25,6 +25,15 @@ git maintenance start 1. Run `git maintenance start` in your repository. +#### ProTips +> [!TIP] +> Set up maintenance on large repos to keep them fast. + +> [!TIP] +> Use with cron or scheduled tasks for automation. + + + #### Links - [Official Docs](https://git-scm.com/docs/git-maintenance) diff --git a/contents/git-request-pull.md b/contents/git-request-pull.md index a3d1b08..11c05b9 100644 --- a/contents/git-request-pull.md +++ b/contents/git-request-pull.md @@ -27,6 +27,15 @@ git request-pull v1.0 https://github.com/example/repo.git v1.1 1. Run `git request-pull ` to generate a pull request message. +#### ProTips +> [!TIP] +> Use request-pull to generate a summary for code reviews. + +> [!TIP] +> Include a clear start and end point for clarity. + + + #### Links - [Official Docs](https://git-scm.com/docs/git-request-pull) diff --git a/contents/view-and-clean-up-local-git-branches-bash.md b/contents/view-and-clean-up-local-git-branches-bash.md index 70ea0d9..a156988 100644 --- a/contents/view-and-clean-up-local-git-branches-bash.md +++ b/contents/view-and-clean-up-local-git-branches-bash.md @@ -35,6 +35,15 @@ git branch -vv | grep -E '^\s*\S+\s+[^\[]+$' | awk '{print $1}' | xargs git bran - ⚠️ Deleting branches is irreversible. Double-check before running destructive commands. +#### ProTips +> [!TIP] +> Use 'git branch -vv' to see tracking info for all branches. + +> [!TIP] +> Pipe to 'awk' and 'xargs' for batch deletion. + + + [➡️ See the Next Step: View and Clean Up Local Git Branches (PowerShell)](./view-and-clean-up-local-git-branches-powershell.md) --- diff --git a/contents/view-and-clean-up-local-git-branches-powershell.md b/contents/view-and-clean-up-local-git-branches-powershell.md index 24978ce..e570ad8 100644 --- a/contents/view-and-clean-up-local-git-branches-powershell.md +++ b/contents/view-and-clean-up-local-git-branches-powershell.md @@ -35,6 +35,15 @@ git branch -vv | Select-String -NotMatch "origin/" | ForEach-Object { $branch = - ⚠️ Deleting branches is irreversible. Double-check before running destructive commands. +#### ProTips +> [!TIP] +> Use PowerShell's 'Select-String' for flexible filtering. + +> [!TIP] +> Automate cleanup with a script for regular maintenance. + + + --- _Author: mike-rambil • Updated: 2024-06-10 • Tags: branches, cleanup, powershell_