Created
July 19, 2021 13:24
-
-
Save atomicstack/e82d92122e1aeb97ef0ff5397d094bd1 to your computer and use it in GitHub Desktop.
fixes annoying "error: refs/remotes/origin/${branch_name} does not point to a valid object!"
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
#!/bin/bash | |
git for-each-ref --format="%(refname)" | while read ref; do | |
git show-ref --quiet --verify $ref 2>/dev/null || git update-ref -d $ref | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment