![]() ![]() People probably have made updates into the project you've cloned (that explains the commits behind) and you've also made commits since you've cloned, and didn't pushed yet (and that explains the commits ahead). Io.stderr:write('can\'t clone submodule '. If not execute('git clone -depth=1 -single-branch -branch='. If submodule and path and submodule_url then cd $module git submodule update -init -recursive -remote -no-fetch -depth=1Įxecute('mkdir -p '. Io.stderr:write('can\'t clone repository from '. If not execute('git clone -single-branch -branch master -depth=1 '. Local module = arg or module_url:match('.+/(+)%.git') Its peculiarities: all the submodules hosted on the same host and. Remark: the script is only tested against repository. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |