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:
git -c core.sshCommand="ssh -i ~/.ssh/id_ed25519" clone git@...repo.git
Set ssh key per project:
git config core.sshCommand "ssh -i ~/.ssh/id_ed25519"
Changing committer name and email per repository
git config user.name "John Doe"
git config user.email "john@doe.org"
Generate ssh PEM key for deploy keys
ssh-keygen -t rsa -m PEM
Reset author for all branch commits
git rebase -r --root --exec "git commit --amend --no-edit --reset-author"
Mount remote folder using an specific ssh key
sshfs -o IdentityFile=/home/andres/.ssh/id_ed25519 USER@SERVER:/home/ubuntu .