命令行

154 阅读1分钟

一定要加源

一定要先拉代码

修改源:npm config set registry registry.npm.taobao.org

查看源:npm config get registry

全局安装软件:npm install -g xx

git branch -m oldName newName

git fetch --all

git reset --hard xx ===》git push -f -u origin xx

删除本地:git branch -d xx

删除远程:git push origin --delete xx

git branch --all 查询所有分支

--------

代码提交

git add ./

git commit -m "提交内容"

git pull origin 分支名

git push origin 分支名

git branch +名称 创建分支

git checkout +名称 切换分支

git checkout -b dev-7.3 origin/dev-6.19 创建并切换分支

创建新分支记得提交上去,一起开发的人才能使用

git 常用命令

1、拉取git上最新项目

git clone --depth=1 xxxx.git

2、提交未跟踪和修改文件

git add .

3、查看提交文件

git status

4、提交注释名称

git commit -m “xxx"

5、拉取git上项目代码

git pull origin xxx // xxx为分支名称

6、提交git上项目代码

git push origin xxx // xxx为分支名称

7、查询git分支

git branch

8、切换分支

git checkout xxx // xxx为分支名称

8、合并分支
git merge xxx // xxx为分支名称
8、查询git的项目地址

git remote -v

9、回退git版本

git reset --hard 456dcfaa55823476b30b6b2e5cbbb9c00bbcbf56

10、切换新分支
git checkout -b iss53
11、切换远程git新分支

git checkout -b iss53 origin/iss53

12 退出登录
git config --system --unset credential.helper
13 删除远程分支

git push origin --delete dev

14 删除本地分支
git branch -D dev
15 查看本地分支commit版本

git show

16 增加项目源

git remote add origin xxxxx

17.查看所有远程分支

git fetch

18.更新远程分支

git remote update origin --prune