Skip to main content
For developers

Git pull every repository in a folder

A DockRun workflow that updates all the git repositories in one folder with a safe fast-forward pull and tells you which ones it skipped.

The button needs DockRun 0.1.19 or later. On an older version, download the file, then use Settings > Restore or Import… in DockRun.

Runs in DockRun Free, which holds 2 workflows.

What it does

  • Looks at every repository directly inside the folder you chose.
  • Skips any repository with uncommitted changes, so your work in progress is never touched.
  • Runs git pull --ff-only: nothing is merged or rebased, and a pull that can't fast-forward is reported.
  • Ends with a count of pulled, skipped and failed repositories.

What you can change

  • folder - The folder that holds your repositories. Starts as: ~/Projects

The steps

Read the script below before you add it. It is everything this workflow runs.

  1. 1. Pull every repository
    Runs this zsh script · Arguments: {{var.folder}} · Time limit: 300 seconds
    # Runs "git pull --ff-only" in every repository directly inside a folder. Repositories with uncommitted
    # changes are skipped, and nothing is merged or rebased: a pull that can't fast-forward is reported.
    folder="${*:-~/Projects}"; folder="${folder/#\~/$HOME}"
    [ -d "$folder" ] || { echo "No such folder: $folder" >&2; exit 1 }
    export GIT_TERMINAL_PROMPT=0   # never wait for a password
    ok=0; skipped=0; failed=0
    for git in "$folder"/*/.git(N); do
      repo="${git:h}"; name="${repo:t}"
      if [ -n "$(git -C "$repo" status --porcelain 2>/dev/null)" ]; then
        echo "SKIP  $name (uncommitted changes)"; skipped=$((skipped + 1)); continue
      fi
      if out=$(git -C "$repo" pull --ff-only 2>&1); then
        echo "OK    $name: ${out##*$'\n'}"; ok=$((ok + 1))
      else
        echo "FAIL  $name: ${out##*$'\n'}"; failed=$((failed + 1))
      fi
    done
    echo "Pulled $ok, skipped $skipped, failed $failed in $folder"
    [ "$failed" -eq 0 ]
    

After you add it

  1. DockRun shows what is in the file and asks before adding it. The workflow arrives turned off.
  2. Open it, read the steps, then turn on the On switch.
  3. Press Run. DockRun asks before a script runs; tick "Don't ask again for this exact step" once you trust it.

Good to know

It never waits for a password: a repository that needs one is reported as failed.

Last tested: 2026-11-12 · All workflows →

Curious if DockRun is right for you?

Let ChatGPT, Claude, or Perplexity look into it - click below and see what AI actually thinks about DockRun.

Git pull every repository in a folder | DockRun