草庐IT

branches

全部标签

Git: 解决掉远程分支中的 Merge branch... 提交记录

文章目录Git解决掉远程分支中的Mergebranch...提交记录实际操作情况一情况二总结Git解决掉远程分支中的Mergebranch…提交记录原理:采用一个新的分支使用reset--hard回退版本,回退之后使用cherry-pick将源分支Commit应用到修改分支,创建一个新的Commit取而代之合并完成之后返回源分支rebase合并分支,源分支合并完成之后推送到远程,完成修改知道了原理,现在我们来实际操作一下实际操作情况一远程分支现在有这样一个提交日志,我们想要删除b6c6ee5又想要保存修改的内容b6c6ee5(HEAD->master)Mergebranch'master'xx

hint: Updates were rejected because the tip of your current branch is behind(git push线上与本地版本冲突问题)

Git本地代码推送到线上出现的问题错误信息为:error:failedtopushsomerefsto'http://**:**/**/**.git'hint:UpdateswererejectedbecausethetipofyourcurrentbranchisbehindTohttp://**:**/**/**.git! refs/heads/master:refs/heads/master [rejected](non-fast-forward)Donehint:itsremotecounterpart.Integratetheremotechanges(e.g.hint:'gitpu

hint: Updates were rejected because the tip of your current branch is behind(git push线上与本地版本冲突问题)

Git本地代码推送到线上出现的问题错误信息为:error:failedtopushsomerefsto'http://**:**/**/**.git'hint:UpdateswererejectedbecausethetipofyourcurrentbranchisbehindTohttp://**:**/**/**.git! refs/heads/master:refs/heads/master [rejected](non-fast-forward)Donehint:itsremotecounterpart.Integratetheremotechanges(e.g.hint:'gitpu