-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict resolution window labels local as theirs and remote as ours during normal merge. #727
Comments
GitExtensions is actually correct. See the section on merging in this link: http://stackoverflow.com/questions/3051461/git-rebase-keeping-track-of-local-and-remote "ours" is the current branch, while "theirs" is the branch we are merging in. Typical git workflow is to create a local topic branch, commit to it, and then merge into the "master" branch. So, "theirs" is also referred to as "local", and "ours" is referred to as "remote", since it typically follows the state of the remote repository. |
I'm agree with dleinhaeuser, these names are really vague. Beginners are always feel confused while selecting which version to select. I help my friends with git and most of them asked me which choice is correct in that window. I'm not sure that git has one typical workflow, because everyone uses it with own preferences. For example, when I work on a topic branch for a few days or weeks, I prefer to merge master into my topic branch from time to time to prevent merge hell and to resolve conflicts as soon as possible. It helps to keep compatible ready-to-merge codebase and it is really helpful for long feature branches. My suggestions is to just write actual branch names and rely that user know which branch contains actual code. |
yes, its very confusing. Ours and theirs do have actual meaning in git-land: you can use them to change the merge strategy, so you should use them in the same way that git uses them. And yes, mentioning the actual branch name would be best, but I am not sure if kdiff supports that. |
Consider the following sequence of commands:
At this point there will be a merge conflict on test.txt.
So according to git gui's logic, the current branch is "local" and the branch that I am merging into it is "remote". If I continue to use the command line instead of git gui to resolve the conflict, I can run the following commands:
So on the CLI, "ours" refers to the current branch and "theirs" to the one I am merging in. Maybe ours and theirs switch places when merges are done differently. If so, then I am not aware of it. |
Thanks, that makes sense. And, in fact, when you launch kdiff to resolve a conflict, then the current branch (--ours) is referred to as .LOCAL. So, yes, it looks like there is a problem with the menu. |
Okay. Apparently "ours" and "theirs" switch places during a rebase. Could it be, that git gui is set up such, that "local" and "remote" make sense for merge conflict during a pull operation? In any case this certainly confuses people switching from git gui (like me). |
Hmmmmmm, I guess if you do a "pull --rebase", (which I use by default) then the menu may be correct, due to ours and theirs switching. But yes, this is extremely confusing, and should be documented somewhere. Also, the local and remote BTW, you can do this a little more efficiently:
|
dleinhaeuser's original explanation of the issue is correct. Choose local (ours) Choose remote (theirs) You can see this by selecting "Open local with" and "Open remote with" and seeing "local" opens your file with your new changes and remote opens their version. Rebase is trickier (I always look at that picture to make sure I'm doing it the right way, haha). "Ours" & "theirs" is incorrect, in my opinion. |
right. This posting explains things pretty well: http://stackoverflow.com/questions/3051461/git-rebase-keeping-track-of-local-and-remote So, local/remote should be ours/theirs for merge, and theirs/ours for rebase. |
This is particularly confusing for post-pull conflicts, where theirs is clearly remote. Is anyone planning to fix it? |
…olve merge conflicts dialog.
Ok, the labels should be fixed in the above commit. Choose local (ours) Choose remote (theirs) and rebase merge remains unchanged ie. Choose local (theirs) Choose remote (ours) |
…olve merge conflicts dialog.
That would be muuuch easier to understand what is going on if instead of LOCAL/REMOTE or OURS/THEIRS it should simply display the branch names. |
See #6582 for a more recent discussion |
Description
When during a regular local merge there is a conflict, the right click menu of the files listed in the conflict resolution window will show the following entries:
From what I understand about git it should say:
This can be quite confusing, because the two names contradict each other.
How to reproduce
Expected result
A menu opens that contains - among other things - the following entries:
Actual result
A menu opens that contains - among other things - the following entries:
The text was updated successfully, but these errors were encountered: