Created
October 21, 2020 03:14
-
-
Save scumdestroy/bf2db531c8e53ee886d0a7d856fcc763 to your computer and use it in GitHub Desktop.
update all Go repos in one command
This file contains 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/sh | |
#save this line as "gitpullall" and you can use it in any folder to update all repos within it | |
alias gitpullall="find . -maxdepth 1 -type d -print -execdir git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \;" | |
#or here ya go | |
#echo "alias gitpullall='find . -maxdepth 1 -type d -print -execdir git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \;' >> ~/.bash_aliases" | |
#then make sure you run this in '~/go/src/github.com' | |
cd ~/go/src/github.com | |
find ./ -type d | cut -d '/' -f 1,2,3 | sort -u > repolist.txt | |
for x in $(cat repolist.txt ); do cd $x && gitpullall && cd /root/go/src/github.com ; done | |
rm ~/go/src/github/repolist.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment