git 拉取分支合并master&&回滚

1、git checkout -b xxx   新建自己的分支

2、git push origin xxx    把自己分支上传gitlab

3、git add .                                          提交本地文件

4、git commit -m "xx的分支"

5、git pull                                            拉取master代码

6、git push                                           上传代码

7、git checkout master                       切到master分支

8、git merge xxx           合并

9、 git status                                      查看状态

10、git push                                        最终合并到master

 

回滚相关

1、git reset --hard fb479960c0cec5549463ae123d70bdd72ccf6be7

2、查看状态

git status

3、提交

git push origin master

或者加入-f参数,强制提交,远程端将强制跟新到reset版本
git push -f origin master

 

posted @ 2021-06-17 14:30  我要成为女技术宅  阅读(675)  评论(0编辑  收藏  举报