Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Created February 10, 2022 12:30
Show Gist options
  • Save khaosdoctor/c89c27bdff56e116c537b4aa9202163d to your computer and use it in GitHub Desktop.
Save khaosdoctor/c89c27bdff56e116c537b4aa9202163d to your computer and use it in GitHub Desktop.
Few useful commands to streamline git usage
#!/bin/bash
# Delete a branch interactively
git branch | fzf | xargs -n1 git branch -D
# Switch to branch interactively
git branch -a | fzf | sed 's+remotes/origin/++g' | xargs git switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment