npm常用命令

1.npm设置镜像地址

npm config set registry https://registry.npm.taobao.org

2.npm下载依赖,指定私服地址

npm install 包名 --http://xxx.com/repository/xxx/

3.npm查看当前登录账号

npm whoami

4.npm登录私服账号

npm login --http://xxx.com/repository/xxx/

5.npm私服发布包

npm publish 包名 --http://xxx.com/repository/xxx/

6.发布完成查看当前包版本 npm version
更新npm包,需要首先更改version npm version 1.0.1
或者
npm version patch更新一个补丁
npm version minor更新一个小改动
npm version major更新一个大改动

7.发布 npm publish

8.撤销: npm unpublish 包名 --force

9.全局删除某个包 npm uninstall -g vue-cli
10.npm install -g @vue/cli
11.yarn global remove vue-cli
12.yarn global add @vue/cli
13.更新某个包 npm update @xxxx -g

yarn常用命令

1.安装私服依赖

yarn save 包的名字 --registry https://xxx.org/

git常用命令

1.打tag

git tag -a x.x.x -m "说明"
git push origin x.x.x.
git show tag号

2.统计添加、删除代码行数
git log --author="liyaning" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
git log --author="liyaning" --pretty=tformat: --numstat --after=2021-01-01 | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -

3.根据tag号新建分支 git branch newbranch 1.0.0-beta2

4.删除远程tag :git push origin --delete <tagname>
5.clone指定分支:git clone -b dev_jk http://10.1.1.11/service/tmall-service.git
 6.回退到指定版本:git reset --hard CommitID
7.删除本地分支: git branch -d dev20181018
8. 如果删除不了可以强制删除,git branch -D dev20181018
9. 有必要的情况下,删除远程分支(慎用):git push origin --delete dev20181018

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐