首页 > 其他分享 >本地branch: DevTest push 到 远程分支: SmokeTest 失败, 可以尝试 git rebase

本地branch: DevTest push 到 远程分支: SmokeTest 失败, 可以尝试 git rebase

时间:2023-08-10 16:46:44浏览次数:39  
标签:origin SmokeTest git DevTest branch push

1. 本地branch: DevTest push 到 远程分支: SmokeTest 

git push origin DevTest:SmokeTest

失败:

! [rejected] DevTest -> SmokeTest (fetch first)
error: failed to push some refs to 'gitlab.fftech.info:eastern/platform-extensions/sales-channel/store-operation-inspector.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.

2. 

git pull

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> DevTest

3. 

git branch --set-upstream-to=origin/SmokeTest DevTest

branch 'DevTest' set up to track 'origin/SmokeTest'.

4.

git branch -vv

* DevTest 4068103 [origin/SmokeTest: ahead 1, behind 1] improve Tmall Catalogue and Resource Catalogue page
master 8dda247 [origin/master: behind 15] first project

 

5.

git push origin DevTest:SmokeTest   再次报错:

! [rejected] DevTest -> SmokeTest (non-fast-forward)
error: failed to push some refs to 'gitlab.fftech.info:eastern/platform-extensions/sales-channel/store-operation-inspector.git'

hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

尝试:

6. 

git checkout SmokeTest

 

7. 

git merge DevTest

Merge made by the 'ort' strategy.

8. 

git checkout Smoketest

 

9. 

 git checkout DevTest  

Switched to branch 'DevTest'
Your branch and 'origin/SmokeTest' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

10. 

git pull

hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.

 

 

10.

git rebase origin/SmokeTest

Successfully rebased and updated refs/heads/DevTest.

 

11. git status

On branch DevTest
Your branch is ahead of 'origin/SmokeTest' by 1 commit.
(use "git push" to publish your local commits)

 

12.

git push origin DevTest:SmokeTest   

成功

 

标签:origin,SmokeTest,git,DevTest,branch,push
From: https://www.cnblogs.com/pangniu/p/17620743.html

相关文章

  • Mac M1基于Docker Desktop部署Gitlab
    一、拉取镜像##这个是gitlab的arm64镜像dockerpullyrzr/gitlab-ce-arm64v8二、配置容器镜像下载完成后,可在DockerDesktop看到镜像点击run,弹出以下界面,配置端口映射和目录挂载后,即可生成一个容器三、启动gitlab容器四、配置Gitlab以下操作需要在Gitlab容器的命令......
  • git 手动解决冲突
    git手动解决冲突:介于<<<<<<<HEAD和=======之间的内容是代码块A中内容介于=======和>>>>>>>之间的内容是代码块B中内容如下图所示:解决方案:手动删除A代码块内容,或者手动删除B代码块内容;或者A和B合并一下代码然后把多余的>>>>>符号和======符号都删光最后暂存,......
  • Git fetch-pack: unexpected disconnect while reading sideband packet
    GitClone拉取代码提示以下错误remote:Enumeratingobjects:57218,done.remote:Countingobjects:100%(57218/57218),done.remote:Compressingobjects:100%(15392/15392),done•error:7107bytesofbodyarestillexpectedGiB15.03MiB/sfetch-pack:une......
  • github
    https://github.com/hckingking/ githubhttps://github.com/godvking 府头邦 Git是由Linux之父LinusTovalds为了更好地管理linux内核开发而创立的分布式版本控制/软件配置管理软件。Git是一个管理你的「代码的历史记录」的工具。 https://hckingking.github.io/ 博客 h......
  • Gitlab的使用
    推荐步骤:1.创建自己名字目录初始化为本地git仓库,设置管理git仓库账户密码为自己名字2.创建第一个文件自己名字.txt提交描述为v1,在自己名字文件中附加数据提交描述为v23.查看git提交日志,将数据回滚到v1版本4.创建分支为bob,模拟开发数据提交版本为v3,切换到master分支合并分支数据,删除......
  • git merge 和 git rebase
    gitmerge和gitrebase都是用来进行分支的合并操作。1、gitmerge在合并分支的时候会保留子分支的commit内容,同时主分支上会有一个commit的提交。log会有完整的子分支结构。如下图2、gitrebase合并分支的时候会将子分支上的修改,放到主分支的最前面,同时会重写原始分......
  • Git命令 含GPG签名
    Git免密登录,之后最多再登录一次gitconfig--globalcredential.helperstore[credential]helper=store学习资源连接:Git教程-廖雪峰的官方网站(liaoxuefeng.com)ProGit(中文版)(gitee.com)深入浅出Git教程(转载)-小奔的早晨-博客园(cnblogs.com)GIT基础命令#......
  • 一文理解GIT的代码冲突
    对于GIT,不知道有没有人和我一样,很长时间都是小心翼翼、紧张兮兮,生怕一不小心,自己辛苦写的代码没了。特别是代码冲突,更是难到我无法理解,每次都要求助于百度,跟着人家的教程一步步解决,下一次还是这样。所有的紧张、不自信、不敢用、用不好,都来源于:不理解。只要理解了,你会发现所有......
  • GIT协作流程规范
    分支模型集中式的分支模型 目前团队使用的模式属于老旧的集中式分支模型,简单的总结就是:开发时: 团队的所有成员都在dev分支上开发(也支持少部分的特性分支feature-xxx)。测试时: 当功能需要上测试环境测试时,把dev合并到test分支,使用test分支在测试环境中测试。灰度时: 在发......
  • Ubuntu gitlab 磁盘扩容记录
    使用vgdisplay命令查看剩余LVM卷组信息,利用lvextend命令进行扩容,最后使用resize2fs命令直接执行vgdisplaylvresize-l+100%FREE/dev/mapper/ubuntu--vg-ubuntu--lv//按百分比扩容resize2fs/dev/mapper/ubuntu--vg-ubuntu--lv引用:https://www.cnblogs.com/gcc2020/p/......