Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a local git repo in lerna?

I am trying to use lerna for the first time. When I use:

lerna import /path/to/my/create_react_app

This is the response:

lerna notice cli v3.13.1
lerna ERR! Error: Command failed: git rev-parse HEAD
lerna ERR! fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
lerna ERR! Use '--' to separate paths from revisions, like this:
lerna ERR! 'git <command> [<revision>...] -- [<file>...]'
lerna ERR! 
lerna ERR! HEAD
lerna ERR! 
lerna ERR!     at makeError (/usr/local/lib/node_modules/lerna/node_modules/execa/index.js:174:9)
lerna ERR!     at Function.module.exports.sync (/usr/local/lib/node_modules/lerna/node_modules/execa/index.js:338:15)
lerna ERR!     at Object.execSync (/usr/local/lib/node_modules/lerna/node_modules/@lerna/child-process/index.js:22:16)
lerna ERR!     at ImportCommand.getCurrentSHA (/usr/local/lib/node_modules/lerna/node_modules/@lerna/import/index.js:129:34)
lerna ERR!     at ImportCommand.initialize (/usr/local/lib/node_modules/lerna/node_modules/@lerna/import/index.js:98:31)
lerna ERR!     at Promise.resolve.then (/usr/local/lib/node_modules/lerna/node_modules/@lerna/command/index.js:271:24)

How can I import a local repo into the lerna packages folder? (git version 2.17.2 (Apple Git-113))

like image 334
bier hier Avatar asked Mar 17 '19 05:03

bier hier


People also ask

How do I import a Git repository to local?

Select Repos, Files. From the repo drop-down, select Import repository. If the source repo is publicly available, just enter the clone URL of the source repository and a name for your new Git repository.

What does lerna Import do?

Lerna is a monorepo manager for JavaScript projects. It helps you take a large codebase and split it into independently deployable packages. Lerna handles every step in the release process — from downloading dependencies, and linking packages together, to testing and publishing updated packages to the NPM registry.


1 Answers

I found the solution: commit the lerna repo and try again .

like image 159
bier hier Avatar answered Oct 12 '22 15:10

bier hier