Skip to content

Instantly share code, notes, and snippets.

@huettern
Last active December 3, 2019 12:30
Show Gist options
  • Save huettern/b4ed2c7bffefeef84f7f48a160da84e6 to your computer and use it in GitHub Desktop.
Save huettern/b4ed2c7bffefeef84f7f48a160da84e6 to your computer and use it in GitHub Desktop.

Delete local branches that were delete on remote

git remote prune origin
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d

Unstage a file

git reset HEAD <file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment