✏️ Used different approach for multiple remotes
This commit is contained in:
parent
32f82f3031
commit
e618f80155
1 changed files with 9 additions and 7 deletions
16
scripts/bgit
16
scripts/bgit
|
|
@ -250,7 +250,7 @@ if [ $numrepos -eq 0 ] ; then
|
|||
else
|
||||
|
||||
# creates a list of repos and puts them in an array
|
||||
remotearray=($(git remote))
|
||||
# remotearray=($(git remote))
|
||||
# Grabs all new files
|
||||
newfiles=$(git status --short | grep '??' | awk '{print $2}' | tr '\n' ' ')
|
||||
# Grabs all modified files
|
||||
|
|
@ -296,9 +296,10 @@ else
|
|||
git reset --hard ${commitarray[$version]}
|
||||
|
||||
# and pushes it to remote repository
|
||||
for ((i = 0; i < numrepos; i++)) ; do
|
||||
git push --force ${remotearray[i]} ;
|
||||
done
|
||||
git remote | xargs -L1 git push --all
|
||||
# for ((i = 0; i < numrepos; i++)) ; do
|
||||
# git push --force ${remotearray[i]} ;
|
||||
# done
|
||||
|
||||
echo "${txtblue}bgit script has completed! goodbye!${txtwhite}"
|
||||
exit 0
|
||||
|
|
@ -399,9 +400,10 @@ else
|
|||
git commit -m "$gitmoji $cmessage" ;
|
||||
|
||||
# pushes the commit to each repository
|
||||
for ((i = 0; i < numrepos; i++)) ; do
|
||||
git push ${remotearray[i]} ;
|
||||
done
|
||||
git remote | xargs -L1 git push --all
|
||||
# for ((i = 0; i < numrepos; i++)) ; do
|
||||
# git push ${remotearray[i]} ;
|
||||
# done
|
||||
|
||||
echo "${txtblue}bgit script has completed! goodbye!${txtwhite}"
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue