Git Install Submodule

 admin
This repository has been archived by the owner. It is now read-only.
  1. Npm Install Git Submodule Dependencies
  2. Git Adding Submodule
  3. Git Install All Submodules
  4. Submodules In Git
  5. Git Install

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up

Git submodule sync synchronizes all submodules while git submodule sync -- A synchronizes submodule 'A' only. If --recursive is specified, this command will recurse into the registered submodules, and sync any nested submodules within. Configuring the.gitmodules file; Using Git submodules in your CI jobs; Using Git submodules with GitLab CI. Notes: GitLab 8.12 introduced a new CI job permissions model and you are encouraged to upgrade your GitLab instance if you haven’t done already. If you are not using GitLab 8.12 or higher, you would need to work your way around submodules in order to access the sources of e.g., gitlab.

Comments

commented Nov 13, 2014

I want use npm install for clone each git submodule(hosted on github).

party of my package.json file:

When I run npm install download into node_modules only repo files. without .git directory and GIT metadata info.

I have a .gitmodules files contains:

commented Nov 13, 2014

FYI @danielefenix @simonefenix

commented Nov 13, 2014

This looks like correct behavior to me. npm install is not designed to manage your git submodules for you. It's designed to install packages. If you need the git metadata, you should install those dependencies with git, not npm.

It looks like you would've wanted npm submodule, but it was removed in npm@2.1.3 because, well, no one used it and it had been broken for a long time without anyone noticing.

commented Nov 13, 2014

Thank you @KenanY for you reply.

Given the following situation:
a project that uses npm to install 3rd party libs and has git modules in it
each git module is a JS project that uses npm for its dependencies
the need to develop on parent project and module project at the same time
every project involved is hosted in GitHub

Could you suggest how to automatize the rescue of 3rd party libraries of main project, the whole set of git modules and recursively the modules dependencies too once the main project is newly cloned?

Thank you for your support, we really appreciate it.

commented Nov 13, 2014

You could use the postinstall script to initialize your git submodules. Here's an example of what the package.json would look like.

commented Nov 13, 2014

Another approach would be to check out all the git repositories into parallel directories, e.g.,

and then use npm link to connect the dependencies:

That way if you make changes in mod1 or mod2, they can be committed to the appropriate git repository, and you can see the changes right away without having to re-install, re-download etc.

commented Nov 21, 2014

I've found so far maybe an elegant solution using a grunt plugin
https://www.npmjs.org/package/grunt-git

that could automatize git submodules. deps and npm deps

Download slui.exe. Nov 04, 2018  HI. Recently somehow the slui.exe file in my computer has got deleted and for this i can't activate my computer. For this i need to download the file. Slui.exe File Download and Fix For Windows OS, dll File and exe file download Home Articles Enter the file name, and select the appropriate operating system to find the files you need.

commented Jan 21, 2015

Is this still a problem for you? It sounds like you have found a workable solution.

We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and open a new issue!)

Thanks!

commented Jan 21, 2015

no io non ho trovato nessun altra soluzione per ora, quando la troverò
riaprirò la issue
No at this time I not found one best solution. when I will find then I
will reopen this issue

thanks
Stefano

added feature-request and removed support labels Jan 24, 2015

commented Jan 24, 2015

Git repos are never cloned directly into your application. They always follow this process:

  1. npm does a bare clone of the repo into $TMPDIR
  2. npm clones that clone into a directory in your npm cache, and then checks out the treeish that the branch requested mapped to.
  3. npm produces an installable package tarball from that checkout that is then placed into your npm cache.
  4. that cached tarball is installed into your application.

If you want to be working directly from the Git checkout of your project, with all its submodules intact, your best bet is probably to npm link for the project with the submodules, and then npm link <project name> it into the package consuming it. It's more unwieldy than using Git URLs in your package.json, but it will give you the control you need about how files are laid out.

commented Feb 17, 2015

@othiym23 I quoted your anser on http://stackoverflow.com/questions/23527393/can-npm-install-the-git-folder-for-dependencies/28559920#28559920 hope it's ok.
Such a shame that npm won't handle this.

Closed

commented Feb 18, 2015

@motin I feel like the needs of package management and version control are usefully separable here. npm link gives you the power to work on a live version of your package while still having it in source control while remaining agnostic to the underlying version control system, and that seems like the appropriate solution to the problem. The other solutions people have come up with on this issue are a little cumbersome, but that's because, in my opinion, git submodules themselves are somewhat unwieldy. I use them myself, in a few projects, but only in cases (like my vim configuration) where there wasn't a really good alternative.

npm makes calls to git it when it's convenient and helpful, but npm is not meant to be a layer on top of (or a replacement for) Git.

Closing as resolved, or as resolved as it's going to get.

Merged
Closed

commented May 17, 2016
edited

For posterity, I found that my current version of npm (3.8.9) now does install submodules. /drake-more-life-download-album-zip.html. It appears that the feature was added.

commented Jul 17, 2016

I know this is an old and closed issue, but in case it helps anyone else who lands here, another solution is npmgitdev. This is a wrapper which lets you work directly with git repos inside node_modules.

Closed

commented Nov 21, 2016

@Joshuabaker2
in what scenario does it work for you? what's your setup

commented Nov 21, 2016

This was a while ago, so I don't remember exactly - but I believe what I had set up was a git repository as an npm dependency in my package.json. That repo had git submodules, and with older versions of npm those submodules needed to be manually init'd and updated. However, with the more recent versions of npm (such as 3.8.9), those submodules were automatically init'd and updated.

Merged
Closed

commented Jun 9, 2017

I know this is an old and closed issue, but npm version 4.2.0 is not installing submodules for dependencies registered pointing to a git repository.

If I register a dependency pointing to a version it installs the submodules as expected.

Is that the intended behavior?

Closed
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Join GitHub today

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

commented Mar 30, 2015

Add warning when downloading from github repo that uses submodules
(assessed through presence of .gitsubmodules file).

Help for install_github updated to suggest use of install_git with proper args in this case.

Limited testing (with mock responses from download and attempt to download .gitsubmodules).

Partially responsive to #737

added 4 commits Mar 30, 2015
Add warning if github repo contains submodules
Document warning of submodules in install_github
Add testing
Fix help details to point to install_git

commented Mar 30, 2015

Travis CI fails with message below. Seems like a separate issue.

Npm Install Git Submodule Dependencies

commented Mar 30, 2015

Yes looks like @jimhester has a fix in PR #746

Merge branch 'fix/bioc' into fix/install-github-submodule-warn

commented on tests/testthat/test-github.r in 281b212Mar 30, 2015

Causing failure in travis-CI build

reviewed Apr 21, 2015

@@ -98,6 +106,10 @@ remote_download.github_remote <- function(x, quiet = FALSE) {
} else {
auth<-NULL
}
## if repo uses submodules warn user

Apr 21, 2015

  1. I think the comment is extraneous (given how simple the code is)
  2. Can you please use a space after if
  3. warning() looks like it's indented too much
  4. I always use call. = FALSE with warning
  5. I think it would be easier to understand if src_submodules was defined in front of this block

Apr 21, 2015

Thanks! Sorry for missing the indent and if-paren style with this PR.

I've made the changes, and also fixed indent style in changes the tests

- Jaime

Git Adding Submodule

On Tue, Apr 21, 2015 at 6:51 AM, Hadley Wickham notifications@github.com
wrote:

@@ -98,6 +106,10 @@ remote_download.github_remote <- function(x, quiet = FALSE) {
} else {
auth <- NULL
}

  • if repo uses submodules warn user

  • I think the comment is extraneous (given how simple the code is)
  • Can you please use a space after if
  • warning() looks like it's indented too much

4. I always use call. = FALSE with warning

Reply to this email directly or view it on GitHub:
https://github.com/hadley/devtools/pull/751/files#r28778939

commented Apr 28, 2015

Looks good! Could you please add a bullet point to NEWS, thanking your github username?

(FYI github only notifies me about comments, not commits, so when done please add a comment like 'PTAL')

Submodules

commented Apr 28, 2015

Done! PTAL

- Jaime

On Tue, Apr 28, 2015 at 6:18 AM, Hadley Wickham notifications@github.com
wrote:

Looks good! Could you please add a bullet point to NEWS, thanking your github username?

(FYI github only notifies me about comments, not commits, so when done please add a comment like 'PTAL')

Reply to this email directly or view it on GitHub:
#751 (comment)

merged commit 07cfad5 into r-lib:masterApr 28, 2015

commented Apr 28, 2015

Thanks!

commented Apr 28, 2016

I'm attempting to install from a github repository that has a submodule. I've tried to use install_git('[url to repo]', args='--recursive') but I get a warning that args is deprecated. Is there a new prefered method for installing submodules? Now that args is deprecated with install_git()?

Sorry if reviving this issue is inappropriate, I'm happy to start a new one if that is preferred.

commented Apr 28, 2016

Git Install All Submodules

I can't say for certain. But, it seems adopting git2r traded stability for the args. See 1b7e67a

Rather than commenting here, it's probably better to open a new issue regarding git2r and args (unless that discussion has already happened -- I haven't searched). In that issue you could reference this PR.

In any case, the suggestion to use install_git with --args should be removed from the docs to install-github.r

commented Apr 28, 2016

Submodules In Git

@jonkeaneinstall_git() uses libgit2 rather than the git client to clone the git repository. git2r the R client to the libgit2 library does not look it has an interface for submodules on cursory inspection.

Probably the easiest thing to do assuming you do have the command line git client installed is define a simple helper function to clone the repository locally and install from there.

Closed
Closed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Git Install

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.