今天整理下公司操作git 流程,尽量用最最简洁的方式整理出来,方便以后有新来的同事学习使用。
我整理的这个Git操作,基本上只需要一分钟,就可以轻松上手啦!!!
一、 拉取提交操作
1、拉取远程代码 git clone xxxxxxxxx 2、从远程创建分支并切换到创建的分支 git checkout -t origin/develop -b 你的分支名 3、查看分支 git branch 4、拉取远程代码到本地 git pull 5、在新建的分支上开发代码 6、开发完成,上传代码前准备 1)、查看开发的内容 git status 2)、查看代码变化 git diff 7、提交代码前,拉取下远程最新的代码 git pull (如果遇到冲突,:q!) 8、提交代码 git add . git commit -m "提交说明" 9、提交代码到远程分支 git push origin 你的分支名 10、发合并请求
二、 删除操作
1、删除远程分支 git push origin -d <branch> 2、删除本地分支 git branch -d <branch>