Skip to content

Instantly share code, notes, and snippets.

@timabell timabell/git-many
Last active May 5, 2019

Embed
What would you like to do?
deal with multiple git repositories
#!/bin/bash
# refs http://tim.theenchanter.com/2008/06/garbage-collect-every-git-repository-on.html
# This script hosted at https://gist.github.com/1391205
echo "Searching..."
find -L . -maxdepth 2 -type d -name .git | while read dir;
do
pushd "$dir" > /dev/null
cd ..
echo
echo '=============================='
pwd;
echo '------------------------------'
echo "many> git $@"
git "$@"
popd > /dev/null
done
echo "Done."
#!/bin/sh -v
# https://gist.github.com/timabell/1391205
# For when a PR has been merged on github.
# You should have the merged branch checked out.
# This will put you on master, get you up to date and delete the now merged branch
br=`git symbolic-ref --short HEAD`
git checkout master
git fetch --all --prune
git merge origin/master
git branch -d $br
#!/bin/bash
# https://gist.github.com/timabell/1391205
# see also https://github.com/Acader/withPS for powershell
echo "Git repl. Ctrl-c to quit."
while [ true ]
do
echo
read -p "git> " cmd
eval "git $cmd"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.