Skip to content

Instantly share code, notes, and snippets.

@innocarpe
Last active September 22, 2020 06:22
Show Gist options
  • Save innocarpe/d13e175f4222671614f66ff6d15db659 to your computer and use it in GitHub Desktop.
Save innocarpe/d13e175f4222671614f66ff6d15db659 to your computer and use it in GitHub Desktop.
Pull remote branch & Delete merged branches.
#!/bin/bash
# Pull remote branch & Delete merged branches.
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-pp
# 4. Use the command 'git pp'
git pull --prune
git branch --v | grep "\[gone\]" | awk '{print $1}' | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment