当前位置:   article > 正文

sourcetree中常用功能使用方法及gitlab冲突解决_sourcetree如何解决冲突

sourcetree如何解决冲突
  • 添加至缓存:等于git add

在这里插入图片描述

  • 提交:等于git commit

![s(https://i-blog.csdnimg.cn/direct/fe4bba3a9a434389a73c4c70d7b43c40.png)

  • 拉取/获取:等于git pull ,在每次要新增代码或者提交代码前需要先拉取一遍服务器中最新的代码,防止服务器有其他人更新了代码,但我们自己本地的代码在我们更新前跟服务器不一致导致会出现冲突
    在这里插入图片描述
  • 合并分支:当多个人一起开发时,我们不能直接在master直接去做开发这样会导致master的代码会出现混乱,所以需要创建一些测试分支用来我们拉取开发后再合并到master,所以一般都是会先切到测试分支进行开发然后再合并到master
    在这里插入图片描述
  • 推送:等于git push ,在每次提交代码后通过推送本地代码推送到gitlab服务器

在这里插入图片描述

  • 当存在冲突时,大部分是本地的代码没有同步服务器最新的代码,但此时你本地又有一些变更这个时候提交或者拉取都会出现冲突,这时候要先把你本地变更的文件先添加到缓存,然后再拉取一遍服务器最新的代码,拉取后再确认你本地的代码是否要推送到服务器上
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin main:main
POST git-receive-pack (487 bytes)
remote: GitLab: You are not allowed to push code to protected branches on this project.
Pushing to http://xxxx:8010/root/fenmi_api_frame.git
To http://xxxx:8010/root/fenmi_api_frame.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'http://xxx/root/fenmi_api_frame.git'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/885419
推荐阅读
相关标签
  

闽ICP备14008679号