1. git提交自己本地的新代码:
(1)进入g盘gitlab文件夹cd gitlab/
(2)git clone http://xx.com/xx.git(自己在gitlab新建的地址)
(3)cd xx/(进去文件夹)
(4)git status
(5)git add .
(6)git status
(7)git commit -m '代码描述'
(8)git push
(ls -l查看有多少个文件)
2. git拉取新代码的操作命令:
(1)在盘符下右键Git Bash Here
(2)$git clone code地址(http://xx.com/xx.git)
(3)$cd 代码文件夹
(4)$yarn 或 npm install
(5)$yarn dev 或 npm run dev
3.查看分支:$git branch
4.新建分支:$git branch + 分支名
5.提交代码:
(1)$git add .
(2)$git commit -m '代码描述'
(3)$git push
注:第一次提交可能需要配置一下($git config --global user.email "邮箱";
$git config --global user.name "用户名")
6. 合并分支代码:
(1)$git checkout(切换分支)
(2)$git pull(拉取代码)
(3)$git merge +分支名
(4)$git push
7. 回退到修改前的版本:
(1)$git reset
(2)$git add .
(3)$git reset --hard