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

Created on 19 May 2019  路  3Comments  路  Source: lerna/lerna

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 |

Most helpful comment

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?

All 3 comments

Lerna does not support git submodules, sorry.

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?

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.

Was this page helpful?
0 / 5 - 0 ratings