![]() ![]() git directory of submodule and path of submodule in superproject tree. The only complexity is to find out URL, path of. git/modules directory and clone submodule manually using git clone -separate-git-dir command. In this case one need to clean up subdirectory of. Sometimes simple command git submodule update -init -recursive -remote -no-fetch -depth=1 can result in an unrecoverable git error. ![]() to checkout "trunk"), then one can use following Lua script. If one want to clone only HEAD revision of a repository and only HEADs of all the its submodules (i.e. Remark: not too easy way, but workable and it has its own unique pros. displaying the usage ' git submodule foreach ') because the -v was an unknown option for git submodule. Teach " git submodule update" ( man) to accept the option to fix it. Since a56771a (" builtin/pull: respect verbosity settings in submodules",, Git v2.17.0-rc0 - merge listed in batch #3), " git pull -v -recurse-submodules" ( man) propagates the -v to the submodule command, but because the latter command does not understand the option, it barfs. (Merged by Junio C Hamano - gitster - in commit b3b9e5c, ) submodule: accept -v for the update command See commit 6f65f84 () by Sven Strickroth ( csware). " git pull -v -recurse-submodules" ( man) attempted to pass -v down to underlying git submodule update ( man), which did not understand the request and barfed: this has been corrected with Git 2.40 (Q1 2023). 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. 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). 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |