Skip to content

Instantly share code, notes, and snippets.

@rupe120
Last active October 8, 2021 10:33
Show Gist options
  • Save rupe120/92200f38b92dd85721378b9a03707f77 to your computer and use it in GitHub Desktop.
Save rupe120/92200f38b92dd85721378b9a03707f77 to your computer and use it in GitHub Desktop.
Git pull with submodules
# This syntax is compatible with both Powershell and Bash
git pull
git submodule update --init --remote
git submodule foreach -q --recursive 'git switch $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo main)'
git submodule foreach -q --recursive 'git pull'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment