Last active
July 14, 2023 15:27
-
-
Save instantiator/74800bf0db0407f0a3d84fe3e38f3d05 to your computer and use it in GitHub Desktop.
A tiny bash script to reset all your github repos to the main branch. Complements multi-git-status nicely.
This file contains hidden or 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 | |
| for d in */ ; do | |
| echo "Checking: $d" | |
| pushd $d | |
| if git rev-parse --git-dir > /dev/null 2>&1; then | |
| git checkout main | |
| git pull | |
| else | |
| echo "... not a git repository." | |
| fi | |
| popd | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment