The latter command has the advantage of also including nested submodules if any of the submodules in the repository have submodules themselves.įor later versions of git (1.8.2 or above) the recommendation is to use the command $ git submodule foreach git pull origin main Or, if all submodules point towards the branch origin main If the command identifies only fast-forward mergers you can use another foreach command to pull all the changes made in the origins of each submodule Your branch is up to date with 'origin/main'. (use "git pull" to update your local branch) Your branch is behind 'origin/main' by 1 commit, and can be fast-forwarded. $ git status Identify repo and branch of a submoduleĬd to the submodule folder (not necessarily the same name as you can use an alias). If you again inspect the content of the repo, you will find that the submodules are filled up with their respective original content. As outlined above, you need to run two commands to retrieve the submodules (run the commands from the top directory of the cloned superproject): If you inspect the content of the cloned repo, you will discover that the submodules are represented as empty directories. The cloning will normally take only a few seconds, as you are only retrieving an empty shell at this stage. Write the command git clone and paste in the string that you copied from the online repo. Start a Terminal session and change directory ( cd) to the parent folder where you want to clone the Framework. Click the copy sign to the right of the text to copy. To clone the Framework, go the GitHub repo, click the green Code button and select the HTTPS alternative. Karttur’s GeoImagine Framework is available as a git superproject at. To retrieve also the submodule content you must run two additional commands: git submodule init to initialize the local configuration, and git submodule update to fetch all the data for the submodules. When you clone such a project, by default you get the directories that contain submodules, but none of the files within. ![]() We will start the hands-on exercise by cloning a GitHub repo (superproject) with submodules. ![]() It is required for the more advanced submodule management, including as outlined in this post. ![]() The git submodule init command prepares the local repo configuration for submodule processing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |