trackerleft.blogg.se

Git submodule init update
Git submodule init update






git submodule init update

Git-submodule-recursive-update (right-click > “Save Link As…” to download) If you are interested in how it works, continue reading.

git submodule init update

The rest of this post will be about the script I created.įirst, I’ll share the script itself. It was immediately clear that I needed a script to do all this dirty work for me. Heck, there is even the possibility that I’ll have a submodule that has a submodule that has a submodule. I didn’t want to get into a habit of always switching to other directories and doing the submodule processes there as well since I 1) knew that I would forget all-too-often, thus wasting my time, and 2) knew that this would not be the last time that a submodule had submodules.

#GIT SUBMODULE INIT UPDATE UPDATE#

Doing the submodule init and update process wouldn’t do everything I needed in this case as there would be submodules in some subfolder that haven’t been set up. The problem happened as soon as I added a submodule to a repository that was also a submodule of other repositories. For a long time, this is exactly what I did when I would clone a theme repository to start working on it.

git submodule init update

This makes it extremely-easy to keep duplicated code across numerous repositories updated with little or no fuss.Īfter cloning a repository, simply run git submodule init followed by git submodule update in order to initialize all the submodules and update their container folder with the content of the submodule’s repository. I then link it back into the project as a submodule. Each time code is duplicated across different repositories, I break that code out and make it into a separate repository. I have a solid set of code libraries that I’ve written that latch into the WordPress themes we produce at iThemes. I had fun writing about how I work with Git yesterday.








Git submodule init update