

This gitdir directory holds the git config file for your remote, so update that accordingly. /./.git/modules/src/modules/trackchanges Note that for GitHub you may wish to change from using into a ssh:// remote url (to be able to authenticate using ssh) – to do that you’ll want to edit the submodule config file, which you can get from the “.git” file in your submodule:

This gets you into a state where you can edit, commit and push your changes back to the trackchanges repository.

It requires a few additional git commands to change from a detached head into a proper remote branch.
#GIT FETCH A SPECIFIC BRANCH CODE#
Now that we have our submodule playing nicely, it would be useful if we could go and edit this submodule code in place, making commits and pushes, which is exactly what we’ll do next. This will update the trackchanges submodule we added earlier, to the latest Now, git uses the update command to also fetch and apply updates, but this time the arguments are slightly different: after cloning the main repository) to fetch the code for the first time: You’ll need to run a special submodule initialize command (i.e. Using the -b argument means we want to follow the master branch of the trackchanges repository, and after running this command we’ll have an empty src/modules/trackchanges directory. Git submodule add -b master src/modules/trackchanges For example, we’ve created a trackchanges repository (a new feature coming in Komodo 9) that we’re linking into the main Komodo Edit repository as a submodule: To create a submodule, you create a new repository to host your module code and then link that into the main repository project. One special thing to note about submodules, is that by default they are first initialized into a detached head state (like an anonymous git branch), so if you want to work on this submodule code later, you’ll first need to update the information (checkout) to be able to push your changes correctly. You can set the submodule to track a particular branch (requires git 1.8.2+), which is what we are doing with Komodo, or you can reference a particular repository commit (the later requires updating the main repository whenever you want to pull in new changes from the module – i.e. There is a special git submodule command included with git, and this command takes various arguments in order to add/update/delete your submodules. Separate git repository in its own right. There’s a lot of out-of-date information on the web, so pay attention to theĭate of the articles you read, as git has been changing (getting better) all theĪ submodule in a git repository is like a sub-directory which is really a Repositories, but there are still a few things (quirks) you should be aware of. Git submodules work really well for splitting out code bases into separate Powerful IDE with support for multiple languages, including Python, Interesting things about submodules that we’d like to share. Since using Git submodules in our Komodo code base, we’ve learned some
