Skip to content

Instantly share code, notes, and snippets.

@al3xandru
Created March 17, 2012 17:56
Show Gist options
  • Save al3xandru/2063532 to your computer and use it in GitHub Desktop.
Save al3xandru/2063532 to your computer and use it in GitHub Desktop.
Git Submodules and Branches/Tags
According to the Git documentation when using submodules they are recorded at the exact commit they are, but not at symbolic references as master or branch or tag.
Here is a scenario:
1. check out a submodule into master project
2. switch to a specific branch or tag in the submodule
3. add submodule to the master project
4. commit master project
Questions:
1. When someone would check out the master project will he get the submodule version on the branch/tag?
2. If doing a git submodule update will it continue to update from the original branch or will it switch automatically back to master?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment