Questions tagged [git-submodules]

Submodules allow you to keep a Git repository as a subdirectory of another Git repository.

A submodule allows you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate. [Pro Git book]

The parent repo keep track of a submodule in:

  • a .gitmodules file (for the url of the sub repo)
  • a special entry in its index, called gitlink for the commit hash at which the submodule is checked out (a submodule is always initialized in a detached HEAD mode)

Common questions:

3102 questions
1
vote
0 answers

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 to get submodule2's changes? I'm wanting changes…
bilumer
  • 7
  • 2
1
vote
1 answer

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 top of run.py of A the following: import…
alect
  • 103
  • 1
  • 6
1
vote
1 answer

`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 reference pointer to the submodule was updated. Now…
Nasif Imtiaz Ohi
  • 1,563
  • 5
  • 24
  • 45
1
vote
1 answer

Git merge --no-ff and submodules

I'm using msysGit 1.7.6 on Windows XP SP3. I have a project with 2 tracking branches (let's call them b1 and b2 -> b1) and a submodule (let's call it sub). After creating b2 from b1, I checked out another revision of sub in b1, and then merged b1…
orgads
  • 678
  • 8
  • 21
1
vote
1 answer

Cannot open git submodule folder on GitHub online

I recently added this github repo as a submodule in my project repo. I cannot open the root folder of the repo in my project repo here. I looked at this answer and it says that both the name and the commit hash should appear as links but that does…
1
vote
1 answer

Separate FE and BE on Heroku but single repo on Github?

Setup I have a web project whose front and backends are hosted on Heroku separately. It is stored in my machine as so: project root ├── backend │   ├──── stuff │   └──── .git ├── frontend │   ├──── stuff │   └──── .git ├── project-wide config…
jared chong
  • 127
  • 1
  • 6
1
vote
0 answers

How do I use Git submodules with AWS CodeCommit and SSH access?

I'm working on a project which uses AWS CodeCommit, and has 2 main apps, plus a submodule of shared components. On Windows I was able to clone all 3 repositories, and then I navigated into the sharedComponents directory in each of the main apps,…
Sharon
  • 3,471
  • 13
  • 60
  • 93
1
vote
1 answer

Google Cloud Build Trigger - Problem Fetching Submodules

I have source code hosted in Google Cloud Source Repositories. It has a single git submodule which is also hosted in Google Cloud Source Repositories (in the same GCP project). The .gitmodules file looks something like this: [submodule…
commander.trout
  • 487
  • 6
  • 14
1
vote
1 answer

How do I discard modified content in git submodules?

I recently ran a git submodule init and update commits in my staging branch. This led to git downloading a bunch of changes from submodules that I do not want to put into staging and wish to discard completely. Changes not staged for commit: (use…
P4nd4b0b3r1n0
  • 1,951
  • 3
  • 22
  • 31
1
vote
2 answers

Bitbucket pipeline does not handle relative git submodule url for ssh checkout?

I have a bitbucket hosted git repository, which has a git submodule repo. I'd like to use a relative url, to allow both https and ssh usage, in the .gitmodules file: [submodule "sm-ourlib"] path = sm-ourlib # url =…
Rabarberski
  • 23,854
  • 21
  • 74
  • 96
1
vote
0 answers

Gitlab-runner submodule .../.git/modules/... is not an directory

I have a repository with one submodule. The CI is configured to clone the submodule: variables: GIT_STRATEGY: clone GIT_SUBMODULE_STRATEGY: normal I then created two jobs. One job to build on debian and one job build on windows. The debian…
NelDav
  • 785
  • 2
  • 11
  • 30
1
vote
2 answers

How to search for a Git commit in submodules?

I have a repo with multiple submodules. I have a commit's hash but do not know to which submodule it belongs, how I could find it's exact submodule?
ephemerr
  • 1,833
  • 19
  • 22
1
vote
1 answer

Git submodule does not checkout the last revision of the branch

I am working on a project having one git submodule (... and I am absolutely not familiar with that!) and I don't understand why it doesn't get the last revision of the checked-out branch!!! Let me describe what I do more in details... My .gitmodules…
Philippe MESMEUR
  • 737
  • 8
  • 22
1
vote
0 answers

When modyfing content inside a submodule, can I push it to my own repository?

I have a repository where I make use of a library that is available on GitHub. I added that library as a submodule and I made some modifications to it. Is it possible that I can now push the commits of the submodule to my own repository? git push…
Darman
  • 21
  • 5
1
vote
0 answers

Add submodule to repository which is in existing submodule

I wish to save my configuration in a git repository to deploy my configuration files on different machines easily. One of the configuration files I wish to save is zsh. I use oh-my-zsh, which is in ~/.oh-my-zsh in my home directory. This directory…
FalcoGer
  • 2,278
  • 1
  • 12
  • 34
1 2 3
99
100