Git Tricks

These trick assumes you have a remote named 'origin'

GitHub source

Mac/Linux Tricks

Delete all remote branches that are not main

On Delete all local branches that are not main

Find all branches (in remotes and local) that I have created

Replace 'raph' with your name here

Windows Tricks

Initialise git in working directory with latest Visual Studio .gitignore

Delete all local branches that have been merged into main

Delete all local branches that are not main

Copy current branch to clipboard

Delete remote branches with filter

Find all branches (in remotes and local) that I have created

Just replace 'Raph' with your name here

Stage all files for commit except those that are *.config at any level within your git repo

Delete all remote branches that are not main

Delete all remote branches that have been merged into main

Pull multiple repositories in child folders (a.k.a. I'm back from a leave script)