lerna+ git + npm

lerna 命令

$ npm i yarn -g
$ npm i -g lerna
$ lerna clean
$ lerna bootstrap
$ yarn [script]
$ lerna exec --scope @本地包 yarn serve
$ lerna exec --scope @本地包 yarn build
$ lerna add @要建立依赖的包名 --scope=@要安装在哪范围
$ lerna run build
$ lerna run serve

git 命令

$ git add .
$ git commit -m 'feature: xxxx'
$ git push [-u] [-f] origin develop
$ git fetch 
$ git pull [--rebase]
$ git rebase -i HEAD~2
$ git rebase origin/develop
$ git log 
$ git stash [pop]
$ git status
$ git branch [-a] [-d] [-r]
$ git checkout [-b] feature_xxx
//清除本地除了master和develop意外的分支 feature_可以换成别的
$ git branch | grep 'feature_*' | xargs git branch -d 
//清除远程已经合并的分支
$ git remote prune origin;

npm命令

$ npm install -g npm-check-updates //全局安装ncu
$ nuc //==>>查看所有有更新的依赖包
$ nuc -u // 更新依赖

# upgrade only mocha
ncu mocha
ncu -f mocha
ncu --filter mocha

# upgrade packages that start with "react-"
ncu react-*
ncu "/^react-.*$/"

# upgrade everything except nodemon
ncu \!nodemon
ncu -x nodemon
ncu --reject nodemon

# upgrade only chalk, mocha, and react
ncu chalk mocha react
ncu chalk, mocha, react
ncu -f "chalk mocha react"

# upgrade packages that do not start with "react-".
ncu \!react-*
ncu '/^(?!react-).*$/' # mac/linux
ncu "/^(?!react-).*$/" # windows

你可能感兴趣的:(lerna+ git + npm)