-
-
Save gadelkareem/cc1d3e27de239f691cbe720b5b28797b to your computer and use it in GitHub Desktop.
Revisions
-
gadelkareem renamed this gist
Nov 28, 2019 . 1 changed file with 12 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ #!/bin/bash set -e #optional change working directory DIR=${1-$(pwd)} @@ -11,6 +10,7 @@ USER="Github username" TOKEN=$GITHUB_TOKEN ORGANIZATION="organization name" REPOS=$(curl -s https://api.github.com/orgs/$ORGANIZATION/repos?type=private\&per_page=1000 -u ${USER}:${TOKEN} | jq .[].ssh_url | sed -e 's/^"//' -e 's/"$//') for repo in $REPOS @@ -20,9 +20,17 @@ do ret=0 git clone $repo 2> /dev/null || ret=1 if [ $ret -ne 0 ]; then repo_dir=`echo $repo | sed 's/.*\///' | sed 's/\.git//' ` if [ ! -d $repo_dir ]; then echo "Error: Failed to clone $repo" fi fi done for repo in */ ; do echo "Pulling changes for $repo" cd $repo git pull & cd .. done -
gadelkareem revised this gist
Nov 25, 2019 . No changes.There are no files selected for viewing
-
gadelkareem revised this gist
Nov 25, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ #!/bin/bash #requires jq -> http://stedolan.github.io/jq/ set -euo pipefail #optional change working directory DIR=${1-$(pwd)} cd $DIR -
gadelkareem revised this gist
Nov 25, 2019 . 1 changed file with 16 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,26 @@ #!/bin/bash #requires jq -> http://stedolan.github.io/jq/ #optional change working directory DIR=${1-$(pwd)} cd $DIR USER="Github username" TOKEN=$GITHUB_TOKEN ORGANIZATION="organization name" REPOS=$(curl -s https://api.github.com/orgs/$ORGANIZATION/repos?type=private\&per_page=1000 -u ${USER}:${TOKEN} | jq .[].ssh_url | sed -e 's/^"//' -e 's/"$//') for repo in $REPOS do echo "Repo found: $repo" ret=0 git clone $repo 2> /dev/null || ret=1 if [ $ret -ne 0 ]; then repo=`echo $repo | sed 's/.*\///' | sed 's/\.git//' ` cd $repo git pull & cd .. fi done -
potter0815 revised this gist
May 17, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ #!/bin/bash #requires jq -> http://stedolan.github.io/jq/ #optional change working_dir working_dir=${1-$(pwd)} cd $working_dir user="github_username" token="application token" -
potter0815 created this gist
May 16, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/bin/bash #requires jq -> http://stedolan.github.io/jq/ user="github_username" token="application token" organization="Organization_Name" repo_list=$(curl https://api.github.com/orgs/$organization/repos?type=private\&per_page=100 -u ${user}:${token} | jq .[].ssh_url | sed -e 's/^"//' -e 's/"$//') for repo in $repo_list do echo "Repo found: $repo" git clone $repo done