Skip to content

Instantly share code, notes, and snippets.

@royswale
Created May 26, 2022 01:32
Show Gist options
  • Select an option

  • Save royswale/eb9e4c510ae52cf5f1f8bc6909b3980d to your computer and use it in GitHub Desktop.

Select an option

Save royswale/eb9e4c510ae52cf5f1f8bc6909b3980d to your computer and use it in GitHub Desktop.
git pull all
#!/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