Skip to content

Instantly share code, notes, and snippets.

@y2k-shubham
Created December 26, 2017 08:42
Show Gist options
  • Save y2k-shubham/ae82f82660c7b23d6ee54dba50c26fc0 to your computer and use it in GitHub Desktop.
Save y2k-shubham/ae82f82660c7b23d6ee54dba50c26fc0 to your computer and use it in GitHub Desktop.
Git recursive checkout (branch switch) on project with submodules
#!/bin/bash
((!$#)) && echo No branch name, command ignored! && exit 1
git checkout $1 && git submodule foreach --recursive git checkout $1
@y2k-shubham
Copy link
Author

Read about entire setup here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment