Morning routine - updating git repos

Fetch pending changes for all git repositories in a directory using PowerShell

Morning routine - updating git repos
  • Get to work
  • Clock in
  • Make coffee
  • Fetch latest changes from git....

Going through a half dozen repositories that I regularly interact with involves far more typing than I care to do repeatedly.

What I want is to cycle through each repository and do the following

  • git fetch --prune
  • If I'm on the default branch (usually master or develop) and have no local changes then just git pull straight away

Sounds perfect for automation! PowerShell to the rescue, leaving time to savour the coffee


Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to SimonReynolds.ie
Great! Next, complete checkout for full access to SimonReynolds.ie
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.