Skip to content

Instantly share code, notes, and snippets.

Clean local branches except master|main|develop:

git branch | grep -v '\*\|master\|main\|develop\|staging\|production' | xargs -n 1 git branch -D

Execute a command using an specific ssh key:

git -c core.sshCommand="ssh -i ~/.ssh/id_ed25519" push origin main

Clone a project using an specific ssh key: