Skip to content

Instantly share code, notes, and snippets.

@blackenedstrang
blackenedstrang / update_git_repos.sh
Created May 11, 2017 13:33
Update all Git repositories inside some folder
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "Pulling in latest changes for all repositories..."
# Find all git repositories and update origin for all of them
for i in $(find . -name ".git" | cut -c 3-); do
@blackenedstrang
blackenedstrang / update_them_all
Last active March 28, 2017 15:31
Update all Git and SVN repos in folder
# pull all Git repos inside a folder
dir -r -i .git -fo | % { pushd $_.fullname; cd ..; write-host -fore yellow (get-location).Path; git pull --rebase; git status; git gc; popd };
# update all SVN repos
# dir -r -i .svn -fo | % { pushd $_.fullname; cd ..; write-host -fore yellow (get-location).Path; svn update; svn status; popd }
Read-Host "Press ENTER to exit"