publish fails on git add -- when a package is a git submodule
See original GitHub issueExpected 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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?