

#Git submodule get update
Commiting these changes will persist the new submodule tracking your desired branch. The git submodule update command actually tells git that you simply want your submodules to each check out the commit already mentioned in the index of the. Now from your primary repository you still have two modified objects.

Just easily I could set it to specific commit or tag.

#Git submodule get how to
Continue reading to learn more about how git submodule works, the best use cases for git submodule, and how to use git submodule safely and effectively. It is the preferred option because it can point to a snapshot of a specific commit in another repository. Now the submodule is fixed on the development branch instead of HEAD of master. A git submodule references another repository so that you can incorporate external code. Git checkout -b dev_branch origin/dev_branch In order to change the submodule to track a particular commit or different branch change directory to the submodule folder and switch branches just like you would in a normal repo. ** Step 2 : Fix the submodule to a particular commitīy default the new submodule will be tracking HEAD of the master branch but will NOT be updated as you update your primary repo. ** Fraser Speirs has a good writeup on what is going on behind the scenes with the Git internals and how the key to all of this is in the index files of each repo and the modes the changes are committed with.
#Git submodule get full
gitmodules will contain the submodule’s local path and source URL and a new folder named qunit which contains a full clone of your source repository. Git submodule add git:///asynchrony/qunit.git qunitĪfterward there will be two modified and staged objects in your repo. Its submodule concept allows us to include and manage third. First grab the GitHub url for my QUnit fork (eventually this will be replaced with the main QUnit repo) and execute the “add” command from within your local repository root. Git, the world’s most popular version control system, offers a great way to manage these dependencies in an elegant, robust way. A superproject is a Git repository in which the superproject Git goes into a submodule Git and does a git checkout hash (or git switch -detach hash ), by hash ID, to get a detached HEAD in the submodule Git repository. Once the module is checked out, I need to add the QUnit submodule. A submodule is a Git repository (so it has its own branch names, tag names, and commit objects). In addition, I need my Git submodule to point to a specific commit (or branch) so that everyone cloning my code consistently can run my examples w/o fear that a new commit on HEAD will break something. The man page for git-submodule as well as the Git Book chapter on Submodules do a good job of documenting the command with some simple examples, but none that were 100% clear for my needs. A single submodule should allow me to keep QUnit-CLI inherently pointing to a particular revision of QUnit.js without requiring me to seperately document which version I was testing against. I have used SVN:externals prevsiously so Git submodules seemed like an obvious solution. While working on getting QUnit-CLI cleaned up and refactored a bit, I realized I needed to tie the example code in the Git repository to a particular version of QUnit.js (those guys are making changes too fast for me to keep up).
