mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2025-12-30 14:09:30 -06:00
chore: auto-generate README.md from toc-source.json
This commit is contained in:
@@ -6,6 +6,15 @@
|
||||

|
||||
> 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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -27,6 +27,15 @@ git request-pull v1.0 https://github.com/example/repo.git v1.1
|
||||
1. Run `git request-pull <start> <url> <end>` 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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
|
||||
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user