Last active
September 3, 2020 10:27
-
-
Save Tharwat96/ff1b8d25c9360430a52ac58e107426f3 to your computer and use it in GitHub Desktop.
git scripts
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
# sort all branches in repository by date updated | |
git for-each-ref --sort=committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))" --no-merged=origin/HEAD refs/remotes/origin |
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 | |
# this script allows for pulling all branches in a remote repository | |
for i in $(git for-each-ref --format="%(refname:short)" --no-merged=origin/HEAD refs/remotes/origin); do \ | |
git switch --track $i; \ | |
git pull --ff-only; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment