Last active
October 27, 2017 14:46
-
-
Save jpeak5/920a966b3b8247ee0d7dd9ad3322cda9 to your computer and use it in GitHub Desktop.
Revisions
-
Jason Peak revised this gist
Oct 27, 2017 . 1 changed file with 15 additions and 8 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 @@ -11,11 +11,18 @@ root=${1%%/} if [ -z $2 ] then for d in $(find $1 -type d -name '.git'); do if [ -d $d ] then cd $d/.. wkdir=$(pwd)/ echo ${wkdir#$root} $(git -C $wkdir rev-parse HEAD) $(git -C $wkdir config --get remote.origin.url) fi done else while IFS=' ' read dir rev branch remote; do git -C $root$dir fetch $branch done < $2 fi -
Jason Peak revised this gist
Oct 25, 2017 . 1 changed file with 4 additions and 3 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 @@ -7,14 +7,15 @@ # https://stackoverflow.com/questions/949314/how-to-retrieve-the-hash-for-the-current-commit-in-git # https://stackoverflow.com/questions/171550/find-out-which-remote-branch-a-local-branch-is-tracking # https://stackoverflow.com/questions/4089430/how-can-i-determine-the-url-that-a-local-git-repository-was-originally-cloned-fr # excellent - https://opensource.com/article/17/6/bash-parameter-expansion root=${1%%/} for d in $(find $1 -type d -name '.git'); do if [ -d $d ] then cd $d/.. wkdir=$(pwd)/ echo ${wkdir#$root} $(git -C $wkdir rev-parse HEAD) $(git -C $wkdir config --get remote.origin.url) fi done -
Jason Peak revised this gist
Oct 25, 2017 . 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 @@ -5,6 +5,8 @@ # https://stackoverflow.com/questions/11981716/how-to-quickly-find-all-git-repos-under-a-directory # https://stackoverflow.com/questions/9612090/how-to-loop-through-file-names-returned-by-find # https://stackoverflow.com/questions/949314/how-to-retrieve-the-hash-for-the-current-commit-in-git # https://stackoverflow.com/questions/171550/find-out-which-remote-branch-a-local-branch-is-tracking # https://stackoverflow.com/questions/4089430/how-can-i-determine-the-url-that-a-local-git-repository-was-originally-cloned-fr root=$1 -
Jason Peak revised this gist
Oct 25, 2017 . 1 changed file with 8 additions and 8 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,10 +1,10 @@ #!/bin/bash ## thanks to # https://askubuntu.com/questions/429229/how-to-check-in-a-bash-script-if-passed-argument-is-file-or-directory # https://stackoverflow.com/questions/5311956/bash-remove-first-directory-component-from-variable-path-of-file # https://stackoverflow.com/questions/11981716/how-to-quickly-find-all-git-repos-under-a-directory # https://stackoverflow.com/questions/9612090/how-to-loop-through-file-names-returned-by-find # https://stackoverflow.com/questions/949314/how-to-retrieve-the-hash-for-the-current-commit-in-git root=$1 @@ -13,6 +13,6 @@ for d in $(find $root -type d -name '.git'); do then cd $d/.. wkdir=$(pwd) echo ${wkdir#$root} $(git -C $wkdir rev-parse HEAD) $(git -C $wkdir config --get remote.origin.url) fi done -
Jason Peak created this gist
Oct 25, 2017 .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,18 @@ #!/bin/bash ## thanks to # https://askubuntu.com/questions/429229/how-to-check-in-a-bash-script-if-passed-argument-is-file-or-directory # https://stackoverflow.com/questions/5311956/bash-remove-first-directory-component-from-variable-path-of-file # https://stackoverflow.com/questions/11981716/how-to-quickly-find-all-git-repos-under-a-directory # https://stackoverflow.com/questions/9612090/how-to-loop-through-file-names-returned-by-find # https://stackoverflow.com/questions/949314/how-to-retrieve-the-hash-for-the-current-commit-in-git root=$1 for d in $(find $root -type d -name '.git'); do if [ -d $d ] then cd $d/.. wkdir=$(pwd) echo ${wkdir#$root} $(git -C $d rev-parse HEAD) fi done