You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Very unclear how to deal with merge conflicts in the UI (even combined with the command line) #1627
This is a general comment on the UI in GitHub Desktop. How do you envision using the GUI to resolve conflicts? I can't figure it out, even combining the UI with the command line. Maybe this is because I don't understand the state that it puts the local repository in, but I want an idiot proof way to tell my (relatively non-technical) collaborators how to deal with conflicts.
Version
GitHub Desktop version: 0.5.5
OS version: Windows
Steps to Reproduce
Create a typical conflict with a local change and a remote change
On the Pull, it "Detached HEAD" with some changeset. At this point, if you run git status on the commandline, it says something like:
rebase in progress; onto 30ae50d
You are currently rebasing branch 'master' on '30ae50d'
Lets say I go and make the local modifications to resolve the conflict. What now in the UI? (I can't even figure it out with a combination of the UI and the commandline).
Or, even easier: lets say I just want to completely reset to the remote repository and then make the changes. How do I do it in the UI (or even the commandline!) with the rebase and Detached HEAD? FOr example, the following DID NOT WORK:
git rebase --abort
git checkout master
git fetch origin
git reset --hard HEAD
We want to do much more to support merge conflicts in the UI and we welcome any feedback as we figure this out, see #71 for one example.
On the Pull, it "Detached HEAD" with some changeset. At this point, if you run git status on the commandline, it says something like:
rebase in progress; onto 30ae50d
You are currently rebasing branch 'master' on '30ae50d'
This confused me at first. The client shouldn't put you into a rebase when you pull. Is it possible that you have some custom configuration in your global config that forces pull to use rebase? In-progress rebases is not something that we've had time to support in the client thus far. With the default behavior of merge pulls I believe your story becomes a lot easier.
Pull from a remote or merge from a local branch which will cause a merge conflict
The clients shows a dialog message saying that you now have a merge conflict and indicates which files in the file list has conflicts
You resolve these conflicts, either in your editor by manually removing the conflict markers or by invoking git mergetool from the command line
@niik Thanks for the response, and it is a good sign that you are as confused as I was!
This is setup in about as vanilla a repository as you can imagine. No customization, nothing ever done on the command-line, only one branch, etc. Absolutely no funny stuff intended (though maybe bugs in the desktop threw it into a weird state?) I downloaded the desktop from the link: https://desktop.github.com/ and the version number says 0.5.5
To exactly replicate what I did:
The remote repository only has the master branch. Nothing fancy or abnormal.
I deleted the whole local repository directory from disk, selected it in the github desktop and told it to remove it when it says it couldn't find it.
Went back onto github and opened the repository in the github desktop, and did the clone. The only branch shown is the "master" branch
I modified and committed a README on the github website, as well as on my local machine (same line of the README to ensure a conflict)
Did a "pull origin" in the github desktop
It correctly detects the conflict, and says "We found some conflicts while trying to rebase. Please resolve the conflicts before continuing"
The screenshot immediately following me closing that dialog is the following.
Note the "Detached HEAD, On ee8537c" in the typical branch dropdown. However, if I hit that dropdown it only shows the "Default branch" and I can't go back to that "Detached HEAD" if I select it. Also note the "Publish branch" button.
Now, I go to the file and resolve the conflict, and save the file I want to push to the remote See the following screenshot before the Commit
Now, I choose to "Commit to master" and you can see the next screenshot.
Note that the "Detached HEAD" changed to some new changeset hash, and the "Publish branch" button is still there (i.e., no "Push").
If I push the "Publish branch" it does nothing.
If I click on the "Detached HEAD" and select master, I am basically reset to where I started... See the final screenshot:
@jlperla Could you paste the output of git config -l here? If there's anything in there that looks like it might be personal information feel free to redact/obfuscate it.
The remote repository only has the master branch. Nothing fancy or abnormal.
I deleted the whole local repository directory from disk, selected it in the github desktop and told it to "Remove it" when it says it couldn't find it.
Went back onto github web, told it to open in the github desktop, and did the clone. The only branch shown is the "master" branch
I modified and committed a README on the github website and "commited directly to the master branch"
Modified the same file on my local machine (same line of the README to ensure a conflict), and commited the change to master.
Did a "pull origin" in the github desktop
It correctly detects the conflict, and says "We found some conflicts while trying to rebase. Please resolve the conflicts before continuing"
Ran a git-bash terminal. Here is the output form "git config -l"
$ git status
rebase in progress; onto 974c4d4
You are currently rebasing branch 'master' on '974c4d4'.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
Your global git config forces git pull to use rebase instead of merge and at the moment we don't have any support for rebase (see #1652). Ideally we would respect this setting but I think in the short term our only option is to explicitly tell pull to do a merge rather than a rebase. A stretch goal could be to let the pull do a rebase but if we detect that it fails we could abort it and do a regular merge instead.
That did it! Thanks so much, it is all very clear how to resolve conflicts now. It must have been set by SmartSVN or one of the other git clients I tried.
Since having that setting put everything into an unrecoverable state, I think that forcing a merge instead of a rebase (or even just refusing to do a pull with conflicts if rebase=true) is fine. Pretty much anything to prevent breaking the repository with a setting people may not realize they have.
Activity
niik commentedon May 19, 2017
Hey @jlperla.
We want to do much more to support merge conflicts in the UI and we welcome any feedback as we figure this out, see #71 for one example.
This confused me at first. The client shouldn't put you into a rebase when you pull. Is it possible that you have some custom configuration in your global config that forces pull to use rebase? In-progress rebases is not something that we've had time to support in the client thus far. With the default behavior of merge pulls I believe your story becomes a lot easier.
git mergetoolfrom the command linejlperla commentedon May 19, 2017
@niik Thanks for the response, and it is a good sign that you are as confused as I was!
This is setup in about as vanilla a repository as you can imagine. No customization, nothing ever done on the command-line, only one branch, etc. Absolutely no funny stuff intended (though maybe bugs in the desktop threw it into a weird state?) I downloaded the desktop from the link: https://desktop.github.com/ and the version number says 0.5.5
To exactly replicate what I did:
The screenshot immediately following me closing that dialog is the following.
Note the "Detached HEAD, On ee8537c" in the typical branch dropdown. However, if I hit that dropdown it only shows the "Default branch" and I can't go back to that "Detached HEAD" if I select it. Also note the "Publish branch" button.
Note that the "Detached HEAD" changed to some new changeset hash, and the "Publish branch" button is still there (i.e., no "Push").
jlperla commentedon May 23, 2017
@niik I noticed this was tagged as an enhancement. If you look through my screenshots and MWE, this is almost certainly a bug.
niik commentedon May 23, 2017
@jlperla Could you paste the output of
git config -lhere? If there's anything in there that looks like it might be personal information feel free to redact/obfuscate it.jlperla commentedon May 24, 2017
@niik Thanks so much for looking into it. To step through the exact steps here:
niik commentedon May 24, 2017
So this is the culprit 👇
Your global git config forces
git pullto use rebase instead of merge and at the moment we don't have any support for rebase (see #1652). Ideally we would respect this setting but I think in the short term our only option is to explicitly tell pull to do a merge rather than a rebase. A stretch goal could be to let the pull do a rebase but if we detect that it fails we could abort it and do a regular merge instead.jlperla commentedon May 25, 2017
That did it! Thanks so much, it is all very clear how to resolve conflicts now. It must have been set by SmartSVN or one of the other git clients I tried.
Since having that setting put everything into an unrecoverable state, I think that forcing a merge instead of a rebase (or even just refusing to do a pull with conflicts if rebase=true) is fine. Pretty much anything to prevent breaking the repository with a setting people may not realize they have.
niik commentedon May 25, 2017
Thank you for confirming that!
Yup, I agree. I'll move this issue into M5 to track enforcing pull merges
Disregard pull rebase configuration
eassymo commentedon Jan 19, 2018
Still "Very unclear".