Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nataliemarleny/62a9b78e3814197f23b8fd1d091e1fa5 to your computer and use it in GitHub Desktop.
Save nataliemarleny/62a9b78e3814197f23b8fd1d091e1fa5 to your computer and use it in GitHub Desktop.
Fetch and reset latest changes in multiple repositories
for f in $(ls); do
cd $f && git fetch --prune origin && git reset --hard origin/$main_branch_name && cd -;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment