Skip to content

Instantly share code, notes, and snippets.

@aduth
Created March 8, 2018 03:03
Show Gist options
  • Select an option

  • Save aduth/671734dcfda49a45c10d255931395141 to your computer and use it in GitHub Desktop.

Select an option

Save aduth/671734dcfda49a45c10d255931395141 to your computer and use it in GitHub Desktop.
Git remote all remotes except origin
#!/bin/bash
git remote -v | grep "(fetch)" | sed -e 's#[[:blank:]].*##g' | grep -v "origin" | xargs -n 1 git remote rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment