Questions tagged [git-submodules]
Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
3,057
questions
0
votes
0
answers
6
views
In git, what may cause the error message " fatal: Unable to find refs/remotes/origin/HEAD revision in submodule path 'Assets/NRSDK'"
Example project:
https://github.com/hpvdt/HMD-nreal
When I checkout this project and try to synchronise with all its submodule, I got a very concerning error message:
git submodule update --remote --...
0
votes
0
answers
8
views
Update submodule in virtual environment with poetry
How can I properly update the git submodule within poetry's virtual environment?
This is the project's folder structure:
main-project-repo/
├── .venv
│ ├── lib
│ │ ├── submodule-package
│ │ │...
1
vote
1
answer
17
views
Control workflow and files from a master repo
I would like to use an admin repo, where some Github actions should be developed and some static config files should be set.
The idea is then to use Backstage to use the admin repo as a template.
I ...
0
votes
1
answer
41
views
Cloud Build does not populate Git submodules
I have a Google Cloud Build trigger which I've set to a Github repo which has the option selected Cloud Build configuration file (yaml or json).
The repo has a submodule but I'm afraid the submodule ...
0
votes
1
answer
27
views
Why are git submodules not cloned when using git clone --recursive?
My git submodule clone is not working.
The repository in question is this.
I have run roughly the following commands.
hugo new site 0xNOY.github.io
cd 0xNOY.github.io
git init
git submodule add https:/...
0
votes
0
answers
23
views
View merge conflict for submodule
I have a repository called "parent", and within this I have a submodule. I have branched both. My friend made changes to the main branch of both. I merged in the changes to the submodule and ...
0
votes
0
answers
21
views
Best way to mirror resources from a separate Git repo, inside another repo with no need to commit or push?
So there is three ways to do this and I'm looking for the best fit for my current situation. Here is a good write up about the differences: https://github.com/ingydotnet/git-subrepo/blob/master/Intro....
1
vote
0
answers
11
views
Is there a way to keep global submodule cache instead of <project>/.git/modules/<submodule>?
I have a multiple projects which are using some common submodules. Some of those submodules are really huge. Now each of these projects are keeping whole copy of the repo in their .git/modules ...
-1
votes
1
answer
41
views
How to sync a local repo so that any local submodules which aren't in remote are wiped?
Let's say you have a local repo and want it to be exactly as the last commit in your remote repo.
These are the steps that I'm typing in order to achieve this:
cd <main repo>
git clean -fxd ...
0
votes
0
answers
15
views
Clone git with default reference repositories including submodules
we are using git for multiple projects, that are using hundreds of submodules. Most projects are using the same submodules, but when cloning them on the local disk, every project receives a full clone ...
0
votes
0
answers
32
views
How to build image in GitLab CI job when git repository contains submodules that require credentials?
I have a Django project that is managed by multiple repositories:
main repo - the Django project (incl. manage.py)
multiple submodules - each represents an app that is installed in the Django project....
0
votes
1
answer
35
views
How can I get a common local clone of a git repo and share it as a submodule of multiple other local git repo clones?
I have multiple projects (repositories) which use the same submodules. Every projects submodule is displayed in the vs-code source control "overview".
Screenshot of source control overview
I ...
0
votes
0
answers
22
views
Can't Location Ref from submodule
I'm working on finalizing the install script of my dotfiles. I use a submodule called dotbot and I'm trying to fix an issue with the git submodule.
Currently I'm running the following command in my ...
0
votes
1
answer
47
views
How to delete a git submodule locally?
I want to delete a submodule locally without pushing the changes to mainline.
Here is what I have done:
https://gist.github.com/myusuf3/7f645819ded92bda6677
// Remove the submodule entry from .git/...
0
votes
0
answers
18
views
Jenkins git submodule not found when using GitHub App authentication and repo/submodule are in different GitHub organizations
I have a GitHub repository referencing a submodule in a different org. Authenticating as my user account, I can clone the repository and update the submodule.
I need the same behaviour in Jenkins. ...
0
votes
0
answers
40
views
Using storybook inside git submodule
I have a submodule with shared components for several electron-react apps. Adding a Storybook to every app project will be inconvenient, so I want to try to initialize it inside the submodule. Is it ...
0
votes
0
answers
15
views
Python Package: Import submodule and rename it?
I'm creating a timecode python package with the following layout:
timecode/
__init__.py
timecode.py
timecoderange.py
modes.py
timecode.py contains a class called Timecode. ...
3
votes
1
answer
54
views
How can I merge a branch without submodules into a branch with a newly created submodule
I am on master in a repository without submodules. I create a new branch remote and add and commit some changes there. Then, back on master, I convert a subdirectory into a submodule and add and ...
-2
votes
0
answers
35
views
Are git submodules right for my use case?
Suppose to have a "master" repository and inside a "subrepository" with another origin with it's own CI/CD pipeline.
What I would like:
When the "master" repository is ...
0
votes
0
answers
7
views
How can I get rid of the sub module for recipes so I can have access to my recipe links and get rid of the repos directory on the repository
Submodules on repository
I've tried deleting the repos in Github but it proceeds to stay. No idea on how to get access to recipes.
0
votes
0
answers
26
views
compile a file in a submodule
A have a repository which I want to make to be dependent on another repository (submodule). The submodule has a makefile which has a rule to compile a file to be an object one (the one with .o ...
0
votes
1
answer
28
views
Git: Parent repo references an old revision of its submodule - how to change?
I have a Git repo parent (P) with a submodule (S). Locally everything is fine, both P and S are up to date, however in remote repo (GitLab) I can see parent repo is somehow stuck on old revision of my ...
0
votes
0
answers
21
views
How can I split a string, while looping through git-submodules? [duplicate]
What I am trying to achieve
Im trying to create a script which automatically creates a new branch and updates the minor version of each git-submodule present, eg. 1.2.3 -> 1.3.0. Creating the ...
0
votes
1
answer
30
views
Using `git pull --recurse-submodules` returns the submodule directories empty [duplicate]
I'll start off by asking not to be judged for my use of git... It might not be optimal but it has worked so far. At the moment I am using it to sync all of my university projects between my devices. ...
1
vote
1
answer
57
views
How to recursively update only git submodules that are set up to track a branch?
Let's say my .gitmodules defines many submodules. Some submodules track branches while others don't.
In my desired workflow, I'd run a single command that updates only the submodules which track a ...
0
votes
0
answers
25
views
Editing a git submodule if you are not the owner
In my software project I am using a submodule which was posted by somebody else. I now want to edit the submodule so that it works in the context of my larger project, and push the changes to my own ...
1
vote
0
answers
90
views
Git: Could not reset submodule index when checking out
I'm trying to checkout a specific commit ID along with all its submodules.
git checkout --recurse-submodules 7fdb9221d958acda289904951fe6d37873e8cfbf
But I'm getting the following error:
fatal: not a ...
1
vote
0
answers
27
views
Recursively list files in other git branches with submodules
How does one recursively list the files in a git branch, including the contents within the commit in a submodule that the branch references? The branch is currently not checked out, and I want to ...
0
votes
1
answer
123
views
Use Directory.Build.props or targets file from subdirectory
We have few solutions that reside in different git repositories, that use a shared project as a git submodule (one repo linked to another repo as a subdirectory in the "parent" repo). We ...
0
votes
0
answers
20
views
empty git submodules inside a container running on AKS
I have all my grpc protobuf file in a single repository and every other service uses git submodules to have access to the necessary protobuf file.
each services have CI github actions that build the ...
0
votes
2
answers
40
views
Git: Pull and Merge Questions
I'm following Git tutorials but I'm still not very clear about the Pull command and the effects on the remote and local repositories.
My two questions are the following:
Q1:
Let's say I have a project ...
-1
votes
1
answer
25
views
How to update submodule to a specific commit from a repo without branch name?
While working with git submodules I had a though to update the submodule
by providing only the submodule repository URL and commit id ( Commit id could be present in any branch of the submodule ...
0
votes
1
answer
62
views
How to Import a golang package which has git submodule depedency in it
I want to create a repo containing json files let us say mapping of countries to country ids, and import this repo in a golang package using git submodule for example called as transformer which reads ...
1
vote
0
answers
30
views
How can I rewrite the history of .gitmodule so that I can change all submodule origins across all history
Basically, I needed to move some repo's around and several of the repo's have submodules. I have edited my .gitmodule file to change the origins to the new location, however, it appears that checking ...
0
votes
0
answers
31
views
How to create a shallow submodule?
I'm trying to setup the Linux kernel as a submodule of a project. It needs to be shallow (or more correctly, I don't need the history), and it should be checked out at kernel 5.10.
I have tried this:
...
1
vote
1
answer
44
views
GitLab runner submodule update init problem
I am using GitLab Community Edition 15.8.0. I have two private repo which are module1 and mkdocstest. I am using GitLab-runner to make the ci/cd process. mkdocstest include the module1 repo as a ...
0
votes
0
answers
29
views
Remove git repository from folder
I cloned into a GitHub repository named "apartments". I put the "apartments" folder into another folder named "booking" and made a new repository tied to the booking ...
0
votes
1
answer
35
views
Different git submodules within different branches
Is it possible to have different submodules within different branches? For example, branch 1 would only see submodule 1 and branch 2 would only see submodule 2.
One option is to use git submodule ...
0
votes
1
answer
23
views
Git switch to branch including submodules return fatal error
I am facing an issue using git submodules. My git version is 2.25.1 (on Ubuntu 20.04) and its structure is as following:
main branch: stable and tested version of my code.
develop branch (from main ...
1
vote
0
answers
35
views
Unable to git push a submodule, but being able to pull it
I am not very skilled in git. I have a git repo, say mainrepo, with a remote one on Bitbucket. mainrepo has a submodule in mainrepo/modules/mymodule.
I do not understand exactly what a submodules is, ...
0
votes
2
answers
59
views
My c++ project uses boost but when used as a submodule it does not find boost anymore
I have a project "A" that depends on boost, and works quite well.
I created a new project "B", where I included "A" as a submodule. However when I try to compile my ...
0
votes
0
answers
41
views
How to make link to submodule navigate to the default branch instead of specific commit tree on Github remote repo?
I am working with git submodules. I have a parent repo on GitHub, and the submodule repos inside it are links to their respective repos on Github as expected. But I have the following issues:
Repo ...
0
votes
0
answers
84
views
Azure DevOps Pipeline cannot find git-submdoule, if repository was transferred including history. TF401019
We have a git-main-repository that uses a git-submodule. Both repositories are located on Bitbucket and shall both be transferred to Azure DevOps, including the git history.
If we transfer both ...
0
votes
0
answers
35
views
Gitlab CI monorepo with submodules
I have such project structure:
/
/apps/
frontend_1 [git submodule]
frontend_2 [git submodule]
/modules/
ui-components [git submodule]
How can i implement ...
0
votes
0
answers
35
views
Submodules preventing me from staging files in git
I am trying to create a small react application. I have the git CLI installed on my computer.
Once I use create-react-app and it finishes loading, I immediately use git init in the terminal. I then ...
0
votes
0
answers
10
views
Select specific folder on git repository to tranform it in a submodule
Let suppose I have a repository A with this structure:
A
Main
Code1
Code2
then a repository B with this structure:
B
Code1
Code2
There's an way of transform B.Code1 submodule of A.Code1 and B....
0
votes
0
answers
45
views
git submodules branches not fetched
My goal is to create a Gitlab pipeline that automatically updates all submodules of my project. So I've created the following pipeline:
update:submodule:
image:
name: alpine/git
entrypoint: [...
0
votes
0
answers
38
views
Splitting Repo into submodules or subtrees
I have tried a few things and have found the right solution yet.
What I have in a single git repo.
Original Repo:
AuthApi
ClientApi
AnotherApi
Data
DataService
What I think I need for build ...
0
votes
0
answers
17
views
Using --quiet with git commit for submodule foreach - not working
I use a zsh script for pushing submodules. This is the line where I am having an issue:
git submodule --quiet foreach "git checkout --quiet main ; git pull --quiet; git add . > /dev/null; git ...
0
votes
1
answer
73
views
How to resolve a merge conflict
I got a merge conflict in multiple files when I tried a pull request in a github repo. While I know how to resolve merge conflicts in a normal case, my situation seems more convoluted.
Master branch:
...