Skip to content

Instantly share code, notes, and snippets.

@bogas04
Created September 17, 2019 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogas04/874731db80967c040209fea396bf7804 to your computer and use it in GitHub Desktop.
Save bogas04/874731db80967c040209fea396bf7804 to your computer and use it in GitHub Desktop.
# Install lerna globally
npm i -g lerna
# Change directory to your work folder
cd ~/Work
# Make the folder you want to keep your monorepo in
mkdir portal-web
# Change directory to monorepo folder
cd portal-web
# Initialize lerna (it will handle `git init`)
lerna init
# Commit the changes
git add . && git commit -m "Initial commit"
# Import other packages (https://github.com/lerna/lerna/tree/master/commands/import)
lerna import ~/Work/portal-mweb
# That's pretty much it!
# Fun fact: If you want to rename your package, simply rename the folder before importing.
# Fun fact 2: You might need to flatten out the commits in most cases (https://github.com/lerna/lerna/tree/master/commands/import#--flatten)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment