Git submodule add example11/30/2023 ![]() Git commit -m"Removed the submodule third-party" Submodule 'third-party' () unregistered for path 'third-party' Push the code (git push command) to update the central repository.Remove the directory for the next commit.This will delete all files inside the folder along with the folder itself. ![]() Remove the folder – Use Linux delete directory command (rm).git/config file) of the submodule given in the command line. Deinit the submodule (git submodule deinit ) – This is the first step that will remove the references (in.The removal of a submodule in Git is performed in the following steps. git submodule update -recursive -init Git submodule remove. git clone -recurse-submodules Git submodule update.Ĭlone submodules later, using the git submodule update command with -recursive and -init command-line options. Use a -recurse-submodules option with the clone command to bring the code of submodules. You may use the option to fetch the code of submodules at the time of clone or later. However, empty folders are created for each submodule. Submodule code is not automatically copied when cloning a repository. git commit -m" Added submodule third-party" We need to commit and push for future usage. Submodules are added just like other resources. Remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Remote: Counting objects: 100% (3/3), done. In the absence of a folder name, the repository’s name will be used. It requires two arguments: the URL and the folder name (optional) containing the code of the submodule. The git submodule add command adds a module to the repository. The following examples show how to add, clone, update and remove the third-party submodule in the main project using the git commands. To demonstrate, we have taken two git repositories, one for our project and another for a third-party library. This eliminates the manual work required to keep all third-party software updated. You can clone all the included submodules when you clone the main project. Submodules in Git are convenient for referring to the other remote projects from your development line. This tutorial will discuss what a submodule is and how to add, remove and update submodules in your working project.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |