![]() When using this command, your detached HEAD will be updated to the newest commit in the submodule repository. GITKRAKEN COULD NOT CONNECT TO ORIGIN UPDATEUsing the “–remote” command, you will be able to update your existing Git submodules without having to run “git pull” commands in each submodule of your project. In order to update an existing Git submodule, you need to execute the “git submodule update” with the “–remote” and the “–merge” option. In some cases, you are not pulling a Git submodule but you are simply look to update your existing Git submodule in the project. The submodule is always set to have its HEAD detached at a given commit by default : as the main repository is not tracking the changes of the submodule, it is only seen as a specific commit from the submodule repository. Submodule path 'vendors': checked out '43d08138766b3592352c9d4cbeea9c9948537359'Īs you can see, pulling a Git submodule in our colleague Git repository detached the HEAD at a given commit. Submodule 'vendors' () registered for path 'vendors'Ĭloning into '/home/colleague/submodules/vendors'. ![]() To update its own Git configuration, it has to execute the “git submodule update” command. In its Git repository, our colleague first starts by cloning the repository, however, it is not cloning the content of the Git submodule. Going back to the example we described before : let’s pretend that we are in a complete new Git repository created by our colleague. To pull a Git submodule, use the “git submodule update” command with the “–init” and the “–recursive” options. If you don’t execute this command, you will fetch the submodule folder, but you won’t have any content in it. ![]() ![]() Whenever you are cloning a Git repository having submodules, you need to execute an extra command in order for the submodules to be pulled. In this section, we are going to see how you can pull a Git submodule as another developer on the project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |