Questions tagged [git-submodules]
Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
2,775
questions
0votes
0answers
12views
How to specify the git submodule URL dynamically in .gitmodules file? [duplicate]
My repository's .gitmodules file is currently like this :
[submodule "app/src/main/assets/my-submodule-repository"]
path = app/src/main/assets/my-submodule-repository
url = git@...
0votes
0answers
21views
How to get git includeIf work for submodule
[core]
editor = \"C:\\Microsoft VS Code\\bin\\code\" --wait
[includeIf "gitdir/i:D:/code/project/"]
path = project.gitconfig
[includeIf "gitdir/i:D:/code/project/acts/...
0votes
1answer
9views
No .gitmodules file to add the line ignore = dirty
So currently I am getting this error in my terminal when trying to commit/push:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "...
0votes
1answer
15views
How do I edit an external submodule, and push it to my own repo?
I am working on my thesis, where I extend another paper. This paper has made all their code public in repo X, also using a submodule themselves: let's call that one Y.
For my own project, I have made ...
0votes
1answer
29views
git push specific files to another remote
I have a git repository containing several linked projects like
|-- configs
| |-- A.py
| `-- B.py
|-- datasets
| |-- a.py
| |-- b.py
| `-- c.py
|-- models
| |-- x.py
| `-- y.py
`-- ...
1vote
1answer
44views
Proper Workflow for Using GitHub submodules with Azure Devops Pipelines (Adding and Checking out)
I know about this question:
Checkout git submodule from azure pipeline
but this answer does not get into how to properly create the submodule in the first place using GitHub PATs.
[My setup]
I have ...
0votes
0answers
21views
Is it possible to clone a submodule in git without getting its master branch?
Say that I have a repo A, that has a submodule B. B has a branch X that A is interested in. Is it possible to clone A, and then get branch X for B, without also pulling down B's master. I tried having ...
0votes
0answers
22views
How do I edit Flutter submodule code and run with native app?
I have a native android project with custom flutter library (that depends on other flutter lib dependency with native android and iOS) that added as a submodule and dependency set up as described here:...
0votes
0answers
14views
SonarCloud can't clone private submodules in GitHub workflow
I am running a SonarCloud Scan on a private GitHub repo which contains private submodules from the same organization
My workflow file /.github/workflows/build.yml is:
jobs:
build:
name: Build
...
3votes
0answers
50views
Missing common classes on a KMM project when integrated in an Android App as a Gradle project
I have an existing Android app where I like to integrate a KMM library project as a git submodule. We want to integrate a git submodule on local builds and using a maven repository dependency on CI ...
0votes
0answers
8views
Typescript project not recognizing property from git submodule
I have a project that has a git submodule with a few shared components, when I try to set the interface to define the component properties it works only when it's everything inside the same file.
Here'...
0votes
0answers
33views
Overly Complicated Git w/Mega-Project & Nested Repos
I'm working on a large project with many sub-components all related to one another and referencing each other. The directory structure looks something like this, with each bullet being a directory, ...
0votes
0answers
25views
Correct approach for dependencies with npm when dealing with submodules
i have some questions and regarding the proper way to handle dependencies in nested projects, added via git submodules. lets assume this structure:
further assume in the top-level package.json ...
0votes
0answers
20views
How to make a submodule behave as. a submodule in git?
I have created 2 submodules in my project. But, these submodules seem to have the commit history of the entire project, not just for the submodule. When I push from the submodule to remote repository ...
0votes
1answer
156views
Error: fatal: Fetched in submodule path 'repository_name', but it did not contain 'SHA-1'. Direct fetching of that commit failed
I'm trying to build & deploy my website through github pages but i keep getting these two errors in "jobs > build > checkout > fetching submodules" for one of my repositories. ...
0votes
0answers
39views
How to move from Git Submodule to Visual Studio Multi Repo
Right now I have a main repo that contains and uses another repo as a submodule.
I want to move to VS Multi Repo and I'm looking for a way to point my SubRepo's branch, same as Git Submodule uses ....
0votes
0answers
15views
Handling submodules while taking pull on parent repository
I have created one simple android application. In this application, I am using another submodule git repository. When I add git submodule into my parent project it creates some entries in the parent's ...
2votes
1answer
209views
ERROR in Plugin "react" was conflicted between
Im using another react repo (lets call it design), in my main react app, as a git submodule. I use webpack to build the main app. After integrating the submodule in the app, Im getting the following ...
4votes
1answer
200views
fatal: remote error: upload-pack: not our ref
We are seeing an odd error only on our CI. We have a git repository (let's call it "OUTER") which contains one submodule ("INNER"). If we clone "OUTER" normally on our ...
0votes
0answers
26views
npm ERR! git dep preparation failed
I'm trying to install a library from github using npm. I run into the following errors when using the line:
npm i --save --save-dev --force --legacy-peer-deps
I receive tons of errors such as:
npm ...
0votes
0answers
20views
git - Copy History of A project with submodules to existing single project
I have a git project contains 10 submodules project. I migrated this project to another as a single project. (All submodules are just a folder in the new project now)
Is there anyway to migrate the ...
1vote
1answer
29views
Git submodule ignore error at branch checkout when that submodule does not have that branch
I have 6 sub modules in a git repository, says submodule1, submodule2,... submodule6.
On 4 sub modules: submodule1/2/4/5 I have a branch, says featureABC, on them.
When I run the checkout command:
$ ...
0votes
0answers
32views
How to avoid duplicate GIT submodule content after moving to another folder? warning: unable to rmdir 'xxx': Directory not empty
Initial Situation / Goal
I have a GIT repository with a submodule let's say under <root>/Modules/SomePath/Example.
I want to move this submodule to a new location, let's say <root>/...
0votes
0answers
20views
A way to always have latest changes from separate repositories?
I have two repositories: main and extra.
I want main to have extra as a new extension and I'm weighing some options on how to do so. I've seen that I could accomplish this with sub-modules, subtrees, ...
0votes
1answer
17views
git push recurse-submodules does not work
I just start to use git submodule, but the behavior is not as expected when push submodules recursively.
My git version is 2.26.2.dirty. My repo is simple, where root-project has one submodule '...
0votes
0answers
17views
git merge remote but the .gitmodules not affected
I'm trying to modify a few codes of a time-series database TDengine (https://github.com/taosdata/TDengine) and intend to contribute back. I forked it to my github account. Then I set it as a remote ...
0votes
0answers
16views
Why does Git submodule always tracks the commit that was current when I made the project
So I have repo A and inside this repo I have repo B as a submodule.
Whenever I clone my repo A from github it always comes with whatever was the head of repo B when I made the project. Is there a way ...
1vote
0answers
49views
How to sharing code between two projects on Azure Databricks
I have two ML projects on Azure Databricks that work almost the same except that they are for different clients. Essentially I want to use some management system so I can share and reuse the same code ...
0votes
0answers
64views
Submodules as yarn workspaces
I've read that workspace packages should not be git submodules (source1, source2).
e.g. this setup restricts the content of packages
root
├── packages
│ ├── package1 # a yarn workspace - should not ...
0votes
2answers
79views
How to have the .github workflows sharable or reusable
We have a repo that contains a bunch of workflows that we want to share amongst all of our dev repositories.
github-common-workflows repository:
workflows/build.yml
workflows/test.yml
Is there a ...
-1votes
1answer
13views
Trying to add an already cloned repo as a submodule gives error 'does not have a commit checked out'
Basically I have a repo where I cloned another repo. And now I want to add that sub-repo as a submodule of the parent repo but when I do git submodule add http://sub-repo path-to-sub-repo on the ...
0votes
0answers
14views
git submodule update fails unless each submodule updated individually
I have a repository with submodules hosted on a server accessed using ssh with google-authenticator 2fa.
There are no nested submodules.
After cloning the repository:
$ git submodule init
$ git ...
0votes
0answers
19views
Need to import a module not in the sys.path from a module. What's the best approach?
I think I understand "import" system in Python pretty thoroughly, but I am a bit confused about the "best" approaches in several situation.
In my case, I have this folder structure:...
2votes
0answers
38views
After adding submodule, nuget restores all packages to submodule packages directory in Azure Devops Build
Scenario: We wanted to move some code over to a new repo (NewSln), so we created that new repo, and then added the code back as a submodule in the original repo (OldSln). Had to modify a few ...
0votes
0answers
23views
For a git submodule, which commit will be cloned if no version is specified in .gitmodules?
Does git follow a certain set of rules when the .gitmodules file only specifies path and url for a submodule?
0votes
1answer
20views
Trigger automatic pull/push for submodule after new commit appear
I have a project A and I have added a submodule to another project B.
I see that the submodule used in A is referring to a particular commit, and I would like this to be updated every time a new ...
0votes
0answers
21views
Not able to find proto file from GIT submodule on remote branch
I’m new to submodule and trying to add submodule that contains proto files to my gradle project.
project A
src/main/proto pointing to submodule project B
In my local, I’m able to compile this proto ...
0votes
1answer
90views
How to update git submodule to a specific commit?
git submodule update --remote
Above command updates the submodule to latest commit however I want to update to a specific commit (e.g. to some commit hash). How to achieve that ?
0votes
1answer
24views
Is it possible to add a submodule to a submodule from the top-level git repository?
I'm working on a few game development projects that use the open-source Godot Engine, which supports modules and add-on scripts.
Our team manages a Git repository for the project, as well as some ...
1vote
0answers
18views
Updating git submodule inside a submodule
I have a submodule inside my repo for example repo/submodule1. Inside submodule1there is another submodule, example: repo/submodule1/submodule2. Do I have to checkout and commit changes in submodule1 ...
1vote
1answer
48views
Setting path for GIT submodule within a python project?
I have two projects A and B.
B is a git submodule being called in a script called run.py of A. When I run it, fails telling me it can't find some inner module of B (ERROR 1). To solve this I add on ...
0votes
0answers
17views
Git Submodule versions
I am working with projects that have dependencies and I was wondering, if I have a project with a submodule inside and everything is updated, but I need to check an older version of that project. When ...
0votes
1answer
64views
`git diff --submodule=diff` doesn't show diff in submodule that points to a different repository
As an example of my problem, consider ssh2-rs repo has a submodule at the path libssh2-sys/libssh2 that points to libssh2 repo. Now, within ssh2-rs@0.2.19 [d2ef03f] and ssh2-rs@0.2.20[1fcf8d3], the ...
0votes
0answers
24views
Convert a git submodule into a normal folder with the same name causes trouble
We have a repo with a setup like this:
Main/
|--utilities/
Main and utilities are both git repos (not their actual names). Utilities was added to main as a submodule. We decided that utilities ...
2votes
1answer
111views
Error in Windows Docker git: cd: .git: Not a directory
I have a Windows 10 host with a mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 Docker image,
git was installed via
RUN powershell.exe -ExecutionPolicy RemoteSigned `
iex (new-...
2votes
1answer
81views
git submodule checkout latest commit of different branch from respective remotes
My parent project has a couple of submodules added to it.
For deployment purposes, I want to checkout a specific branch eg master, staging, etc in each submodule and pull the latest commit of this ...
0votes
1answer
80views
Track branches with git submodule
I'm needing to use the git submodules so that my parent repository can track changes that occur in specific branches. I have a project with testing, beta and production branches. Both my parent and ...
0votes
1answer
34views
How to keep folder structure while share common code across projects in git?
I have the following directory structure that I'd like to keep it while share some of the directories across different projects. I'd like to achieve something like this:
root
|_dir1 (git repo1)
|...
2votes
0answers
479views
TF401019: The Git repository with name or identifier public does not exist or you do not have permissions for the operation you are attempting
I have two ADO repositories named private2 and public2. private2 references public2 as a submodule:
I also added a yaml file (vsts-cicd.yml) for build as follows:
resources:
repositories:
- ...
0votes
0answers
25views
How to include latex packages after downloading them as submodules via Git?
I was recently asked to contribute in a latex project which is already relatively large. The main project is in one folder lets call it "project". There ist also another folder called "...