
You could test out and see what is going on with a verbose option: git pull -v -recurse-submodulesīut for that, you will need Git 2.40 (Q1 2023). Need any clarifications? Just post a comment.Īs noted in antitoxic's answer, a simple git submodule foreach -recursive git pull can be enough.įrancis Bacon's answer notes git pull -recurse-submodules can differ. If you are on unix/linux, then I suggest just a bash script.
#Bronze pulls windows#
If you are on a windows platform, you may want to look at using Python to implement the script as it is very capable in these areas. That is, in a sense, what you are doing with the described script, but just more automatically. Typically, you want to say "LibraryX" is at version "2.32" and will stay that way until I tell it to "upgrade". I'd like to mention that this style is not really what git submodules were designed for. At the end, I suggest you print a display to the user to indicate the current status of the submodules - perhaps prompt them to add all and commit?.for each repo listed, cd into it's directory and run git checkout master & git pull.If a sub-repo is modified, you may NOT want to proceed. The first character of the output lines indicates this. check git submodule status for "modified" repositories.

That could be as simple as saying master is the most up to date branch, etc.įollowing this, create a simple script that does the following: In order to do so, you would need to identify what HEAD really is for a submodule. I am pretty sure that git does not have a command for this internally. In response to the comment by the original author about pulling in all of the HEADs of all of the submodules - that is a good question.

If on Windows, you may need to modify the syntax to get it to work :) Just put it in a suitable bin directory (/usr/local/bin).

#Bronze pulls update#
Git pull & git submodule init & git submodule update & git submodule status # Exists to fully update the git repo that you are sitting in. Note: This is from 2009 and may have been good then but there are better options now.
