question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

publish fails on git add -- when a package is a git submodule

See original GitHub issue

Expected Behavior

git add – should not include git sub-modules

Current Behavior

git add – fails with fatal : pathSpec…see more detail below

Possible Solution

maybe exclude sub modules from git add command and run git submodule foreach --recursive git add .

lerna.json

<!-- Please paste your `lerna.json` here -->

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Context

When running publish my private application packages in git submodules are getting version bumped , the application packages are git sub modules and the git add – command fails as the package.json from the sub-module is included.

fatal: Pathspec ‘packages/application/package.json’ is in submodule ‘packages/application’

Your Environment

Executable Version
lerna --version 3.14.1
npm --version 6.9
node --version 10.15.3
OS Version
Linux Mint 19.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
evocateurcommented, May 21, 2019

I am making the choice to say no, that is not worth the extra complexity. A git submodule does not make sense in a monorepo.

6reactions
mjgchasecommented, May 20, 2019

Lerna does not support git submodules, sorry.

So no chance of putting in a function to exclude them or handle them when adding through GIT upon publish? , you are building a development tool which co-exists along side git , seems strange you aren’t willing or unable to handle that scenario?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with adding common code as git submodule: "already ...
I created a separate git repo for the common code and removed it from the projects with the plan to add it as...
Read more >
Git - Submodules - Git SCM
Let's start by adding an existing Git repository as a submodule of the repository that we're working on. To add a new submodule...
Read more >
Git Submodules: Adding, Using, Removing, Updating
Simply run git rm --cached [plugin path] . In this example, I will run git rm --cached lib/billboard . As I've seen noted...
Read more >
Git submodule - Atlassian
Now we can update the parent repository again by doing a git add and git commit on the submodule. This will put everything...
Read more >
No url found for submodule path - DeployHQ
This occurs when the repository is using files cloned from another repository but has had no mapping reference to the source repository created...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found