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
Option to rebase instead of automatically merge when pulling from upstream #3422
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.
Reacted by Jed Fox, Simon Fridlund, strafe, Pav, Tristan Dubé-Lepage, Niklas, Tom Seagrave, Marko Okkonen, Alex, Deniss Alimovs and 273 more
Reacted by Manuel de la Higuera, svein-anfinnsen-eb, Lee Higgins, Binyamin Laukstein, Jianbin, Natalie Rose, Ibrahim Beladi and Mike Brian Olivera
Reacted by Ibrahim Beladi, Romain, Mike Brian Olivera , Abiola Alowosile and Mikko Rantalainen
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.
Reacted by Emrick Donadei, Noel Röhrig, Blas, Ibrahim Beladi, Vinz, ajayrajpurohit111, Lludion and ABHISHEK FADAKE
Reacted by Jacques Cornat, Thomas Wilgenbus and Ibrahim Beladi
Reacted by Pav, Paul Balllas, Zackery Griesinger, Jarne W. Beutnagel, Timo Ernst, Martin Möhwald, Sergio Fedorini, Tyler Barnes, Iannick Brouillette, Jarda Kotěšovec and 20 more
Please use the 👍 button on the original issue to indicate support.
Reacted by Trent, Tyler Barnes, Ole, Jarda Kotěšovec, Agostino Carandente, Isaiah Odhner, Rob Cupples, Nick Lai, Darren Torpey, Natalie Rose and 18 more
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.
For reference, we added --no-rebasehere 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.
Reacted by Neha Batra, Timo Ernst, David Fokkema and Roland Stühmer
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).
Reacted by Mihai Codoban, Paulo Koch, Gabriel and Blas
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.
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!
Reacted by Douglas Cross, Blas, Sam Stickland, Ruud, Joshua de Lange, Mateusz Łoskot, reichn, Lludion and Pavel Chuchuva
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.
Reacted by Trent, Anja Lea Brinkmann and Andrew Patton
Reacted by Ibrahim Beladi, tjshan and Muhammad Yasirroni
@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?
@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).
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:
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.
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.
@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.
Activity
PavelDrozdovERM commentedon Dec 1, 2017
I would also like this feature as old GitHub desktop works that way and it is way nicer
artyom-kolesnikov commentedon Jan 18, 2018
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.
siamkreative commentedon Feb 8, 2018
👍 Please consider this in your roadmap
paulballas commentedon Feb 9, 2018
+1
j-f1 commentedon Mar 13, 2018
Please use the 👍 button on the original issue to indicate support.
Merge branch 'master' of https://github.com/macports/macports-infrast…
iAmWillShepherd commentedon May 17, 2018
Comment from #4711 by @timor-raiman
The part that I want to call attention to is specifying whether to
pull -rper repository.shiftkey commentedon May 18, 2018
For reference, we added
--no-rebasehere because we didn't handle merge conflicts well when the user had setpull.rebase=truein their git config: #1627Improving conflict resolution in the app is on our roadmap and I think is a pre-requisite for this work.
DHager commentedon Jun 4, 2018
Like @artyom-kolesnikov , I'm working with some non-developers... Github Desktop's
defaultrequired merge behavior is proving a bit of a "foot-gun".billygriffin commentedon Aug 14, 2018
From #5391:
billygriffin commentedon Aug 29, 2018
From @niik in #1627:
julien-c commentedon Oct 19, 2018
Hmm, I don't get why this is not a priority 1 at this point.
pull -ris the essential command in so many workflows.billygriffin commentedon Oct 19, 2018
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.
21 remaining items
shiftkey commentedon Feb 21, 2019
@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?shiftkey commentedon Feb 26, 2019
I'm going to drop this from
1.6.3because we've not had discussions about making this an option in the UI as part of this release. If you havepull.rebase=trueset in your Git config you should see thepullbutton change to show this context:I think that will go a long way to helping with the pain outlined in this thread!
billygriffin commentedon Feb 27, 2019
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 eithergit pullorgit pull --rebasein 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.
masaeedu commentedon Feb 27, 2019
@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?billygriffin commentedon Feb 27, 2019
@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).shiftkey commentedon Mar 1, 2019
@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.If you have this set to false and have tracked changes, you'll likely be blocked from doing a
pull with rebase(git pullby 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=trueglobally (I gather you want to avoid creating a merge commit, in which case I'd also ensurepull.ffis set totrue) I'm happy to try and incorporate this feedback as part of iterating on this area.lilgurl commentedon Oct 31, 2019
lilgurl commentedon Oct 31, 2019
9mm commentedon Apr 17, 2020
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.
shiftkey commentedon Apr 17, 2020
@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.
9mm commentedon Apr 17, 2020
@shiftkey thanks!
Voxar commentedon Sep 10, 2025