Created
May 26, 2022 01:32
-
-
Save royswale/eb9e4c510ae52cf5f1f8bc6909b3980d to your computer and use it in GitHub Desktop.
git pull all
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 | |
| # put this script in directory | |
| # D:\laragon\bin\git\usr\bin | |
| # then gpa.sh will be available in git bash | |
| # git push to all remote | |
| remotes=( $(git remote) ) | |
| # coding | |
| # gitee | |
| # origin | |
| # echo "${remotes[*]}" | |
| # coding gitee origin | |
| for i in "${remotes[@]}" | |
| do | |
| # echo "$i" | |
| git push $i > /dev/null | |
| # suppress output | |
| # $(git push $i) &> /dev/null | |
| # last command's status code | |
| # echo $? | |
| done | |
| # coding | |
| # gitee | |
| # origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment