Protip: Finding all of your Git repositories.

code git howto repositories software_development tip
Sep 09 2012

How to find all of the Git repositories in the current working directory:

find . -maxdepth 2 -type d -name '.git' -print | awk -F/ '{print $2}'

How to update all of them in one shot:

for i in find . -maxdepth 2 -type d -name '.git' -print | awk -F/ '{print $2}'; do
echo "Updating repository $i."
cd $i
git pull
cd ..
echo "Done."
done

Antarctica Starts Here.

  • About Me
  • .plan file
  • Coffee?
  • Social Networks
  • People I Follow
  • Stuff I Like
  • Miscellanea
  • About this site
  • Syndication
  • Tag directory

  • Turtles All the Way Down
  • Everything I need to Know In Life, I Learned from Reading William Gibson Novels
  • The Laws of the Twenty-First Century
  • Exocortex Resources
  • A Friendly Introduction to the Fediverse

  • Edward C. Grejda
  • Helen Wendel
  • Crusher
  • © The Doctor [412/724/301/703/415/510]
  • ← l00p →
  • Powered by Pelican
  • Theme: HTML5 UP