Skip to content

Very unclear how to deal with merge conflicts in the UI (even combined with the command line) #1627

Closed

Description

@jlperla

Description

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

Activity

  1. niik commented on May 19, 2017

    @niik
    Member

    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.

    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.

    1. Pull from a remote or merge from a local branch which will cause a merge conflict
    2. The clients shows a dialog message saying that you now have a merge conflict and indicates which files in the file list has conflicts
    3. You resolve these conflicts, either in your editor by manually removing the conflict markers or by invoking git mergetool from the command line
    4. You commit using the client
  2. jlperla commented on May 19, 2017

    @jlperla
    Author

    @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.
      image

    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
      image
    • Now, I choose to "Commit to master" and you can see the next screenshot.
      image
      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:
      image
  3. jlperla commented on May 23, 2017

    @jlperla
    Author

    @niik I noticed this was tagged as an enhancement. If you look through my screenshots and MWE, this is almost certainly a bug.

  4. niik commented on May 23, 2017

    @niik
    Member

    @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.

  5. added
    bug
    and removed on May 23, 2017
  6. jlperla commented on May 24, 2017

    @jlperla
    Author

    @niik Thanks so much for looking into it. To step through the exact steps here:

    • Made sure github desktop updated to version 0.5.7. Reinstalled git for good measure from https://git-scm.com/download/win
    • 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 config -l
       core.symlinks=false
       core.autocrlf=true
       core.fscache=true
       color.diff=auto
       color.status=auto
       color.branch=auto
       color.interactive=true
       help.format=html
       rebase.autosquash=true
       http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
       diff.astextplain.textconv=astextplain
       filter.lfs.clean=git-lfs clean -- %f
       filter.lfs.smudge=git-lfs smudge -- %f
       filter.lfs.required=true
       filter.lfs.process=git-lfs filter-process
       credential.helper=manager
       user.name=jlperla
       [email protected]
       gc.autodetach=false
       pull.rebase=true
       core.repositoryformatversion=0
       core.filemode=false
       core.bare=false
       core.logallrefupdates=true
       core.symlinks=false
       core.ignorecase=true
       remote.origin.url=https://github.com/jlperla/perla_pflueger_szkup.git
       remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
       branch.master.remote=origin
       branch.master.merge=refs/heads/master
    
    • Not sure if it is useful, but here is git status:
    	$ 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")
    
  7. niik commented on May 24, 2017

    @niik
    Member

    So this is the culprit 👇

    pull.rebase=true

    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.

  8. jlperla commented on May 25, 2017

    @jlperla
    Author

    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.

  9. niik commented on May 25, 2017

    @niik
    Member

    That did it! Thanks so much, it is all very clear how to resolve conflicts now.

    Thank you for confirming that!

    think that forcing a merge instead of a rebase

    Yup, I agree. I'll move this issue into M5 to track enforcing pull merges

  10. added this to the M5: Post-Beta Bougie milestone on May 25, 2017
  11. added a commit that references this issue on May 25, 2017
    87b7bad
  12. eassymo commented on Jan 19, 2018

    @eassymo

    Still "Very unclear".

  13. locked as resolved and limited conversation to collaborators on Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions