![]() ![]() Run git submodule update -init if necessary to clone the two submodules. When you are inside the submodule, you can treat it just like a normal repo, and when you are in the parent repository, you can "add" to change the current commit pointer.īut the traditional downside is that you either have to have your users know git submodule commands, so they can init and update the repo, or they have to add -recursive when they initially clone your repo. To add a new commit that fixes both submodules: Check out the superproject, at the tip of the branch that ends with the 'bad' commit. If there is a change in the submodule from the. you will reset the submodule when you rerun CMake if you are developing inside. Once your cd inside a submodule, all git commands are with respect to the submodule and not the superproject. The relative path to the repo is important it allows you to keep the same access method (ssh or https) as the parent repository. If you want to add a Git repository on the same service (GitHub, GitLab. Submodules are tracked by the exact commit specified in the parent project, not a branch, a ref, or any other symbolic reference. ![]() If you want to add a Git repository on the same service (GitHub, GitLab, BitBucket, etc), the following is the correct Git command to set that up as a submodule in the extern directory: gitbook $ git submodule add. Cloning a repository that contains submodules If you want to clone a repository including its submodules you can use the -recursive parameter. Core Concept First, let me provide a brief explanation on a core concept about submodules that will make them easier to work with. git reset -hard origin/Branch name, Delete all local commits. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |