The Nuclear Option
git clean -xdf
Pull rebase
For current repository:
git config pull.rebase true
As a global setting:
git config --global pull.rebase true
https://coderwall.com/p/tnoiug/rebase-by-default-when-doing-git-pull
Fix wrong rebase
git rebase --abort
git rebase --quit
git am --resolved
git am --abort
Pruning branches from remote list
git remote update origin --prune
Purging Secrets from Repo
Use git-filter-repo or BFG repo cleaner:
Guides:
https://improveandrepeat.com/2021/06/how-to-use-git-filter-repo-to-remove-files-from-your-git-repository/ https://peterbabic.dev/blog/clever-uses-for-git-filter-repo/ https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
Automatically Rewriting Git url to use SSH instead of HTTPS
git config --global --add url."git@github.com:".insteadOf "https://github.com/"