Created
November 29, 2017 18:39
-
-
Save jhannah/5a52b081c088fb796ec5fab1cde5888a to your computer and use it in GitHub Desktop.
git pr git pr-clean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: https://gist.github.com/gnarf/5406589 | |
✗ git pr 2528 | |
* [new ref] refs/pull/2528/head -> pr/2528 | |
Switched to branch 'pr/2528' | |
✗ git pr-clean 2528 | |
git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done: -c: line 0: syntax error near unexpected token `"$@"' | |
git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done: -c: line 0: `git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done "$@"' | |
Huh. That's weird. If I run the command does it work? | |
✗ git for-each-ref refs/heads/pr/* --format='%(refname)' for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done | |
Deleted branch pr/2528 (was fcb88bc). | |
uhh... ok, so the command works if I run it, but somehow not as a git alias? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nicknisi is a genius. He pointed out that pr-clean doesn't take an argument. Leave it off and it works fine.