Skip to content

Option to rebase instead of automatically merge when pulling from upstream #3422

Closed

Description

@tbillington

Description

Github Desktop automatically merges upstream commits. This is fine for some projects but quickly dirties the git history with unnecessary merges. This has bitten me and colleagues multiple times in this version and the previous version of Github Desktop with the magic "Sync" button.

Proposal

Add an option in the menu to pull rebase instead of merge, or change button text to "Merge" so that I know it's time to go to the terminal so I can pull rebase.

Version

GitHub Desktop version: 1.0.3

OS version: OSX 10.12.6

Note: I did look for similar issues on this topic but couldn't find them.

Activity

  1. PavelDrozdovERM commented on Dec 1, 2017

    @PavelDrozdovERM

    I would also like this feature as old GitHub desktop works that way and it is way nicer

  2. artyom-kolesnikov commented on Jan 18, 2018

    @artyom-kolesnikov

    We are using GitHub Desktop for artists/designers at work but the history gets dirty very quickly due to lack of this feature :( Will have to switch to more complex git client unfortunately.

  3. siamkreative commented on Feb 8, 2018

    @siamkreative

    👍 Please consider this in your roadmap

  4. paulballas commented on Feb 9, 2018

    @paulballas

    +1

  5. j-f1 commented on Mar 13, 2018

    @j-f1
    Contributor

    Please use the 👍 button on the original issue to indicate support.

  6. iAmWillShepherd commented on May 17, 2018

    @iAmWillShepherd
    Contributor

    Comment from #4711 by @timor-raiman

    Rather than a generic rebase, which is a complicated flow to implement in GUI elements, it would be of great use to our team if it were possible to specify globally or per-repository that all 'pull' operations should rather be 'pull -r'.

    The part that I want to call attention to is specifying whether to pull -r per repository.

  7. shiftkey commented on May 18, 2018

    @shiftkey
    Member

    For reference, we added --no-rebase here because we didn't handle merge conflicts well when the user had set pull.rebase=true in their git config: #1627

    Improving conflict resolution in the app is on our roadmap and I think is a pre-requisite for this work.

  8. DHager commented on Jun 4, 2018

    @DHager

    Like @artyom-kolesnikov , I'm working with some non-developers... Github Desktop's default required merge behavior is proving a bit of a "foot-gun".

  9. added
    user-research
    on Jul 30, 2018
  10. billygriffin commented on Aug 14, 2018

    @billygriffin
    Contributor

    From #5391:

    I often (several times per day) reorder, delete, and squash commits via interactive rebase. It would be nice to implement these commands from the UI client from the History tab by dragging and dropping commits (for reorder and squash) and right click context menu (for delete and rename).

  11. billygriffin commented on Aug 29, 2018

    @billygriffin
    Contributor

    From @niik in #1627:

    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.

  12. julien-c commented on Oct 19, 2018

    @julien-c

    Hmm, I don't get why this is not a priority 1 at this point. pull -r is the essential command in so many workflows.

  13. billygriffin commented on Oct 19, 2018

    @billygriffin
    Contributor

    Hi @julien-c, thanks for the feedback. This is something the team is actively working on, and I realized we didn't make that as clear as we could have - that's my fault. Here's our near-term roadmap which has this on there: https://github.com/desktop/desktop/blob/development/docs/process/roadmap.md

    I'm also going to create a new issue that lays out the scope of our current work, thanks for the nudge.

  14. 21 remaining items

  15. shiftkey commented on Feb 21, 2019

    @shiftkey
    Member

    @billygriffin it's not clear to me where this task sits with respect to the items already in scope for 1.6.3 - are you able to elaborate?

  16. shiftkey commented on Feb 26, 2019

    @shiftkey
    Member

    I'm going to drop this from 1.6.3 because we've not had discussions about making this an option in the UI as part of this release. If you have pull.rebase=true set in your Git config you should see the pull button change to show this context:

    I think that will go a long way to helping with the pain outlined in this thread!

  17. removed this from the 1.6.3 milestone on Feb 26, 2019
  18. billygriffin commented on Feb 27, 2019

    @billygriffin
    Contributor

    After discussing this at length, I'm going to close this issue with #6893 that's shipping in the next beta and very soon to production in 1.6.3. I know this isn't going to perfectly solve everyone's desired use case here, as there's no way to manually select either git pull or git pull --rebase in the UI. However, the behavior we're enabling here does meet the needs of the majority of the people we've heard from to date, and the expectation is straightforward. I'm still trying to reconcile how to meet the needs of folks like @RoystonS and their team, and the recognition that this doesn't quite get us all the way there. So this definitely isn't a final answer, but it's what we're going to ship for now and then evaluate from there.

    We're also building on this work to enable explicit rebasing locally with one branch onto another, so that's coming in the not too distant future as well.

    To reiterate, we're closing this because we don't want to communicate something we're not necessarily committing to, not because we're unwilling to revisit the question of whether to enable more differentiation in the app and not just rely on the user's git config. Thanks to everyone who weighed in on this, it's really appreciated.

  19. masaeedu commented on Feb 27, 2019

    @masaeedu

    @billygriffin I haven't fully followed the progress of the thread, but does this mean that if I set up people's gitconfigs to have pull.rebase=true, the Github UI will never introduce merge commits from master to their feature branch?

  20. billygriffin commented on Feb 27, 2019

    @billygriffin
    Contributor

    @masaeedu Yep, local commits will be rebased on top of remote commits if that is set in the user's git config. Our new implementation also introduces a conflict resolution process that hopefully makes that part a bit less painful than otherwise too, but it's still a thing folks can run into (in the same way they can if it's a normal git pull).

  21. shiftkey commented on Mar 1, 2019

    @shiftkey
    Member

    Btw, a repo-only level config for this (without UI) means I still can't recommend the tool for my team. We usually pull with rebase, but if we have outstanding uncommitted changes, a one-off non-rebase pull (which wouldn't cause a merge) is better. All other tools I've used present a sticky checkbox on a pull dialog.

    @RoystonS I want to call out a helpful Git config setting that helps you better manage uncommitted changes in Desktop, without the need to change the behaviour each time you pull:

    git config --global rebase.autoStash true.

    When set to true, automatically create a temporary stash entry before the operation begins, and apply it after the operation ends. This means that you can run rebase on a dirty worktree. However, use with care: the final stash application after a successful rebase might result in non-trivial conflicts. This option can be overridden by the --no-autostash and --autostash options of git-rebase[1]. Defaults to false. (emphasis mine)

    If you have this set to false and have tracked changes, you'll likely be blocked from doing a pull with rebase (git pull by default is fine here):

    If there's extra context here about why you think a "non-rebase pull" is better here than leaning on pull.rebase=true globally (I gather you want to avoid creating a merge commit, in which case I'd also ensure pull.ff is set to true) I'm happy to try and incorporate this feedback as part of iterating on this area.

  22. lilgurl commented on Oct 31, 2019

    @lilgurl
  23. lilgurl commented on Oct 31, 2019

    @lilgurl
  24. temporarily blocked lilgurlon Oct 31, 2019
  25. 9mm commented on Apr 17, 2020

    @9mm

    This thread has been helpful. @shiftkey do you know by chance if your message there matches the old Desktop app for OSX? The flow on that was literally perfect, and I'm trying to recreate that on version 2. I just don't know the nuances of stash and whatnot, based on how the old app used to work.

  26. shiftkey commented on Apr 17, 2020

    @shiftkey
    Member

    @9mm the stashing flow of the classic app is very different to how it works in the current app. I wrote a while ago about the reasons why it didn't come over as-is #1633 (comment).

    You should look over #6107 which outlined the approach for stashing in the current app.

  27. 9mm commented on Apr 17, 2020

    @9mm

    @shiftkey thanks!

  28. Voxar commented on Sep 10, 2025

    @Voxar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions