gitmodules file (not necessarily the repository root if its submodules contain other nested submodules): git submodule sync This file gets committed to Git.įorce submodules to resynchronize with the modified file using the following command in the folder with the modified. The easiest way I found to do that is as follows: To fix the issue for me (and other SSH users) in repositories which already contain submodules with HTTPS URLs, I have to change the URL. or Usually all repositories in a project are at least hosted in the same service, so this technique can be used. mySubmodule.git example would work as long as the parent repository is in the same GitHub organization, e.g. This works for both HTTPS and SSH users because it uses the root repository URL as base onto which the relative path is applied. The solution is to use a relative URL instead: Url = course, that would cause problems for HTTPS users. Git can handle that but requires you to authenticate over HTTPS, effectively using two different authentication methods for a single repository.įor an SSH user, a correct configuration would be the following: The issue with the above example for an SSH user is the absolute HTTPS path. Each submodule definition consists of a path inside the repository where the files from the submodule are placed and a URL of its repository, as in the following example: Git repositories with submodules are a different story, though. Fortunately, the way I connect to the repository usually doesn't matter, as all Git hosting services support both HTTPS and SSH. I prefer using Git over SSH which makes me a minority in most teams I work with.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |