![]() It is a little annoying to make changes to the submodule due to the requirement to check out onto the correct submodule branch, make the change, commit, and then go into the superproject and commit the commit (or at least record the new location of the submodule). Gitslave (that you already looked at) seems to be the best fit, including for the commit operation. git remote add Here, is the name of the remote repository that you want to add, and is the URL of the remote repository.add and commit in order to record the new commit of the submodule. The syntax for using git remote add is as follows.git fetch/pull to make sure it has the latest commits on the right branch To push to the upstream branch on the remote, use git push second HEAD:master To push to the branch of the same name on the remote, use git push second HEAD.So for a parent to track automatically the latest commit of a given branch of a submodule, it would need to: Since it is a Git repo on its own, the "history of all commits" is accessible through a git log within that submodule. Will get updates from the same branch that you used to initialize the submodule, which is usually what you want.Ī submodule is a single commit referenced by a parent repo. This means that future calls to $ git submodule update -remote. This allows you to easily record a submodule.branch option in. ![]() After that, whenever our code mates need to interact with our branch, they will run the git fetch command. This will help us set up the remote branch for the current local branch. is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository. The alias -u is used as the shortcut for -set-upstream. If you had a submodule already present you now wish would track a branch, see " how to make an existing submodule track a branch".Īlso see Vogella's tutorial on submodules for general information on submodules. ![]() " git submodule" started learning a new mode to integrate with the tip of the remote branch (as opposed to integrating with the commit recorded in the superproject's gitlink). Git 1.8.2 added the possibility to track branches. This answer below still reflect the old naming convention. Edit (2020.12.28): GitHub change default master branch to main branch since October 2020.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |