Questions tagged [git-submodules]
Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
2,988
questions
0
votes
0
answers
4
views
how do i upload a folder, with subfolders inside from local to remote repo avoding the submodule folder?
**every time the result is a submodule folder, thing that i can't open. How do i push so there's folders inside of the main branch?
help please submodule **
0
votes
1
answer
17
views
How to `git add path/to/submodule` but with a specific submodule hash?
How to perform git add path/to/submodule but in a way that will update the staging area to have the submodule set to a specific submodule hash instead of the currently checked out hash?
This would be ...
0
votes
0
answers
13
views
How to change submodules in a GitHub Repository?
I've created a github repository with a submodule in it. I want change the submodule, how i can do it?
Change .gitmodules but nothing
0
votes
0
answers
14
views
How to reuse boilerplate code in multiple similar git repos?
I have the following template structure (simplified) copied across multiple repositories (~50) that implement similar cloud services:
service-xx/
|-- lib/
| |-- utils.py
|
|-- app/
| |-- main.py
| ...
0
votes
0
answers
12
views
How to import from submodules without including "submodules_dir" in the import statement
I have a Python project with several Git submodules structured like so:
myproject/
__init__.py
src/
__init__.py
main.py
submodules/
__init__.py
submodule1/
...
1
vote
0
answers
31
views
Cannot debug a project with nested dependencies in Git submodules
I have a solution with a sample .NET Core microservice that has dependencies on two projects (one of which is dependent on another and dependencies are set up using Git submodules). It builds fine, ...
1
vote
0
answers
11
views
git push --tags failing due to a submodule, which tag?
When I do git push --tags I get
The following submodule paths contain changes that can
not be found on any remote:
packages/jpl
This apparently due to one of the tags as normal pushing works and so ...
0
votes
1
answer
40
views
Unresolved external symbols with git submodules
I have a solution with 2 projects:
A static library (Almond)
A project that uses that static library (Sandbox)
I'm watching and following The Cherno's Game Engine Series except that I'm using C++20 ...
0
votes
0
answers
23
views
Nested Git Submodules Failing to Recurse in Pipeline
I have a nested project structure such that there is a submodule within one of my submodules. The project structure is like this:
project A
|_project B
|_project C
|_project D
Where A ...
0
votes
0
answers
39
views
How to switch to a branch with different set of submodules?
Git project is using Library A as a submodule mapped to a directory library-a/. Submodule configuration in .gitmodule is as follows. This is implemented in main branch and is pushed to the origin.
[...
1
vote
2
answers
33
views
Why do I get "fatal: No url found for submodule path 'TestLibrary1' in .gitmodules" for a submodule that no longer exists?
Problem
When I try to checkout my repository using GitHub Actions I get the following error:
fatal: No url found for submodule path 'TestLibrary1' in .gitmodules
What I Tried
I tried removing the ...
0
votes
0
answers
18
views
Git not recognizing recently added submodule
In my project, I have two submodules. One added in the last commit (subA) and one added after the last commit (subB). I have verified in .gitmodules, .git/modules/, .git/config. In all three places, ...
0
votes
1
answer
25
views
Different git submodules on different Folders on the same git repository
I'll explain the mission.
I have a core git repository with my main software.
I have to use this software for different clients for which I have to specialize.
My goal is to have as many folders ...
0
votes
0
answers
19
views
Working with git nested submodules (stage, commit, push)
I have a set up that looks like this:
- MainRepository
- Folder1 (nested submodule)
- Folder2 (double - nested submodule)
- Folder3 (nested submodule)
- Folder4 (nested submodule)
When ...
0
votes
0
answers
49
views
Correct way to update a GitHub submodule?
My goal is to add the k3s-ansible repo as submodule, into my repo. Since k3s-ansible is an example repo, several files will require edits. Ideally, my main branch will contain k3s-ansible repo with ...
2
votes
0
answers
60
views
Can a Git repository share multiple folders with another one, without the shared folders being submodules, subrepos, subtrees, or symlinked?
The problem
I host a Git repository for the Matter Modeling Stack Exchange, called Modeling Matters. For example, to supplement the answer to question #9743 on the site, a folder called /9743 was made ...
0
votes
0
answers
83
views
CI/CD Pull Request approval after testing in multi repo microservices
I'm working on a personal project that I developed for learning purposes and I'm struggling on how to manage the following use case, similar to this question or this other one.
I have a git repo that ...
1
vote
2
answers
27
views
How can I add commits from submodules to main repository
I have a repository with one submodule.
But I would like the commits made in the submodule to be informed in my tag used in the main repository.
Is it possible to perform this procedure?
Note: I use ...
1
vote
0
answers
30
views
How can I clone a subfolder of a git repository into another git repository as a submodule?
I'm new to git and git submodules. Although I've done some research I can't seem to find a proper answer to what I'm trying to achieve.
So suppose I have a repository called Big Repo cloned locally on ...
0
votes
0
answers
18
views
Checkout a YAML file in another repo using submodule
I have a repository in which I have a YAML file with the following code:
resources:
repositories:
- repository: repoxyz
type: git
name: OneXXXXXX/public
ref: develop
stages:
- ...
1
vote
0
answers
29
views
`git submodule update --remote` vs `git pull --recurse-submodule` vs `git submodule foreach git pull origin main`
There are three commands that (as far as I know) can be used to update a git submodule to its latest version.
git submodule update --remote --recursive
git pull --recurse-submodule
git submodule ...
1
vote
1
answer
51
views
Python setup.cfg: how to add package_data with git submodules?
I'm writing a Python package, in which I'm adding package data. The package data of my setup.cfg looks like the following:
include_package_data = True
[options.package_data]
mypymodule = dir1/*/*, ...
0
votes
1
answer
31
views
Git How to push repo that consist another repo inside?
I have a git repository. I needed to add another folder that consist some code files. And it is a git repository too.
TopFolder
File1.cpp
File2.cpp
.git
InnerFolder
File....
0
votes
0
answers
8
views
How to get the commit IDs of the submodule and their tags? (GITLAB)
I'm using the following command to get the tags in each of the submodules listed from newest to oldest:
git submodule foreach git tag --sort=-taggerdate -l
I'm getting the output below. I grabbed 3 ...
0
votes
1
answer
64
views
Not able to add external library using git submodules in CMake
I am trying to add jwt-cpp library by Thalhammer in my project using CMake.
My project structure is as follows
build
External
---- jwt
.gitignore
.gitmodules
CMakeLists.txt
main.cpp
I used command ...
0
votes
0
answers
15
views
Mongoose, share models through different git repositories
I have a Git repository called "my-app-models" that contains different Mongo models.
Also, I have like 10 backend services each one on a different repository, let's say:
my-app-back1
my-app-...
0
votes
1
answer
32
views
Jenkins BitBucket Error "[WARNING] Reference path does not exist: Bitbucket url" for submodule
I have added git submodule to my project.
Now when I am setting up Jenkins, I am getting this error for submodule:
git submodule init # timeout=10
[WARNING] Reference path does not exist: Bitbucket ...
1
vote
1
answer
62
views
git submodule at a specific commit/tag
The problem: Can I pin git modules to specific commits?
I am writing a build script to produce an artifact which is a Zip archive of multiple submodules with a few requirements.
the artifact ...
0
votes
1
answer
29
views
Gitlab: How to get the commit IDs of a submodule and all of its tags?
I'm using the following command to get the tags in each of the submodules:
git submodule foreach git tag --sort=-taggerdate -l
What I'm trying to do now is to also get the commit IDs, of both the ...
0
votes
0
answers
50
views
git submodule error - picking up latest commit instead of a specific commit
I have a repository with a submodule which includes 3 files:
As you see here, the branch specified in .gitmodules is 'develop' and the ref specified in vsts-cicd.yml is 'develop'.
The git command I ...
0
votes
2
answers
116
views
How to get the commit IDs from all the tags in a submodule?
I'm using the following command to get the tags in each of the submodules:
git submodule foreach git tag --sort=-taggerdate -l
But I'm not sure how to also get the commit IDs for each tag listed.
...
0
votes
1
answer
106
views
Why does git submodule status not match the output of git branch of my submodule?
I made sure that my project was using the hdb branch by doing git submodule --remote meta-dataset. But git submodule does NOT agree with the git branch command when I cd into the repo:
(meta_learning) ...
0
votes
0
answers
17
views
Gitlab: How to get only the matching tag from a submodule's commit ID (Git)
I want to go into a specific submodule's commit ID and get only the tags that have a matching commit ID:
To illustrate the problem, below I put an example:
We're gonna use this specific submodule as ...
-2
votes
0
answers
26
views
How do I pull newly specified submodules that I just added in my .gitmodules file?
I just added to the .gitmodules file:
[submodule "meta-dataset"]
path = meta-dataset
url = git@github.com:brando90/meta-dataset.git
when I try to update it:
git submodule update
git ...
1
vote
2
answers
148
views
Why do I need to add the `--remote` to git's submodule when I specify the branch in the .gitmodule file?
I want to pull/update the submodules at the right branch. Doing git submodule update pulls/updates the submodules but it changes to the wrong branch even when the branch I want to ALWAYS use is ...
1
vote
0
answers
23
views
GUI Branch Strategy w/ Submodules
I have a repo "repo1" with 2 branches "main" and "dev" with 3 submodules "submodule1", "submodule2" and "submodule3".
All 3 submodules can ...
0
votes
0
answers
73
views
Pulling a git submodule with private access from a Github action
I'm trying to pull a git submodule during my 'push' github action. The submodule is a private repository.
I've created a PAT with read-only access to my repositories. And I've added the contents of ...
0
votes
0
answers
32
views
Why does git keeping setting my submodules to (HEAD) when I alter my main repo?
I have a repo with 2 submods inside of it. When in the main repo and switching branches, or pulling changes, seemingly at random, the submods will leave the branch I told them to be on and switch to &...
1
vote
1
answer
31
views
In UML/SysML, what is the best diagram type to represent a SW strategy using GIT Submodules?
When using UML/SysML, what would be the best diagram type to represent a software strategy/structure using Git Submodules?
I am a Git novice, but it seems to me that the UML Package Diagram type is ...
0
votes
1
answer
29
views
The main repository branches link to the corresponding submodule branches
I have two branches master and dev. How to make the master branch of the main repository linked to the master branches of the submodules? Accordingly, the dev branch of the main repository is linked ...
0
votes
0
answers
38
views
GitHub Actions - Add Submodule
Problem
I want to be able to add a submodule automatically using GitHub Actions.
I have tried using the following command (since it works fine when run locally on my computer)
name: Trigger to Add New ...
0
votes
0
answers
9
views
Submodule initialization for already clone project android
So we started using gitsubmodule recently in our project.
This is the .gitmodule file generated
[submodule "ProjectNane"]
path = ProjectNane
url = git url
branch = develop
Now ...
0
votes
0
answers
57
views
Maven multi module project with git submodule: release perform fails
I have a Maven multi-module project. One of the module is a git submodule
proj-root
proj-module
proj-submodule
When I try maven release:prepare, the project fails. I have tried multiple ways but ...
0
votes
0
answers
30
views
How to Git the latest tag of a submodule & excluding tags that contain certain words on it
I have cloned recursively a repo from GitLab and then got the tags of the submodules by using the following command:
git submodule foreach git tag -l
So as an example. I have the following two ...
0
votes
1
answer
55
views
How can I get the latest tag from a commit ID?
I need to get the Tags from a commit ID in a GitLab repository.
Searching past solutions I'm trying to follow this one:
How to find the tag associated with a given git commit?.
I cloned the repository ...
0
votes
1
answer
63
views
git submodule with environment
I have this .gitsubmodule:
[submodule "modules/some-utils"]
path = modules/some-utils
url = ../some-utils.git
branch = main
With that, I will always checkout to main each time ...
1
vote
1
answer
38
views
`git submodule update` always keep fetching the same commit
I have a Git repo with one submodule and two commits that change the submodule's HEAD. If I check out one of the commits, and do a git submodule update, this succeeds without having to connect to a ...
1
vote
1
answer
56
views
How to push submodule changes to the local repo
I have a project in Git which uses mySQL as a submodule. What I'd like to do is update my local tree on all my computers with the changes I made on one of them inside my local copy of mysql tree. Is ...
0
votes
0
answers
34
views
How do I remove the arrow on my Github directory and make it clickable?
This is the directory on Github:
(https://i.stack.imgur.com/HV2Fi.png)
I started this by starting a React Native app inside an existing Github repository.
Deleting the hidden .git file in said ...
0
votes
0
answers
91
views
Build docker image - submodules not working
I am trying to create a docker image for my .net core based application and a build is working fine with blow command where I pull the submodule but as soon as I try to build the docker image on ...