两个同步分支之间出现 Git 冲突

发布于 2025-01-09 18:40:15 字数 844 浏览 0 评论 0原文

序言/上下文:

抱歉,这里缺乏确凿的证据,只是试图收集我遇到的特定 git 问题的概念信息,看看其他人是否遇到过类似的情况。

我对 git 并不陌生,几分钟的谷歌搜索我的问题只能得到解决 git 冲突的一般问题的答案,这不是我的问题。

如果相关的话,我使用 gitlab 14.0 来管理我的远程 git 存储库: https:// /about.gitlab.com/releases/categories/releases/

问题

我遇到的问题是尝试将“开发分支”合并到特定的“主分支”中项目,通过 Gitlab UI(因此,合并过程正在处理开发和主分支的远程版本)。 Gitlab 告诉我存在冲突,因此我无法合并,但是,它无法显示哪些文件受到冲突的影响。 Gitlab 还告诉我,开发分支与 master 分支同步(即 master 上没有未合并到开发分支的提交)。这本身就是一个矛盾。如果开发分支已经将所有提交应用于master,那么它怎么会与master冲突呢?

在我的本地版本的开发分支中,我没有看到所谓的冲突。拉动并推送到远程开发分支(以确保它是同步的),然后拉动远程主分支不会产生任何更改,并且消息“已经是最新的”。因此,两个分支机构之间在当地并没有发生冲突。只有 gitlab 报告了冲突,同样,即使只查看远程分支也是没有意义的。

有没有其他人遇到过这样的事情,我该怎么办?我通常对 git 非常重视,以至于我几乎可以肯定任何错误都是我自己的错,而不是 git 的错。但这似乎确实是 git 的错。

Preamble/context:

Sorry for the lack of hard evidence here, just trying to gather conceptual info on a particular git issue I ran into, and see if anyone else has encountered anything similar.

I'm not new to git, and several minutes of googling my problem only yields answers to the general issue of resolving git conflicts, which isn't my issue.

In case it's relevant, I'm using gitlab 14.0 to manage my remote git repos: https://about.gitlab.com/releases/categories/releases/

Issue

The issue I encountered was in trying to merge a "development branch" into the "master branch" of a particular project, through the Gitlab UI (so, the merge process is dealing with remote versions of the development and master branches). Gitlab told me there were conflicts so I couldn't merge, however, it couldn't show me what files were impacted by the conflicts. Gitlab also told me the development branch was in-sync with master branch (i.e. there are no commits on master that are not incorporated to the development branch). This is a contradiction in itself. If the development branch already has all the commits applied to master, how can it be in conflict with master?

In my local version of the development branch, I did not see the alleged conflict. Pulling and pushing to the remote development branch (to ensure it was in sync, which it was), and then pulling in the remote master branch yielded no changes and the message "Already up to date." So no conflict was seen locally between the two branches. It was only gitlab that was reporting a conflict, which again, didn't make sense even just looking at the remote branches.

Has anyone else encountered such a thing, and what am I supposed to make of it? I usually view git in a glowing light, to the point that I can be almost certain any errors are my own fault and not git's. But this one does seem to be git's fault.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文