Skip to content

Instantly share code, notes, and snippets.

@mjsteinbaugh
Created March 25, 2019 13:12
Show Gist options
  • Save mjsteinbaugh/980d2a8147abaede00507c9cf013295d to your computer and use it in GitHub Desktop.
Save mjsteinbaugh/980d2a8147abaede00507c9cf013295d to your computer and use it in GitHub Desktop.
# Fix detached head in a submodule
# Here's a good explanation on how to fix detached HEAD for submodules.
# https://stackoverflow.com/questions/18770545
git branch
git checkout master
git submodule add -b <branch> <repository> [<submodule-path>]
git branch --set-upstream-to=origin/master master
# git branch -u origin/master master
git submodule update --remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment