Skip to content

Enhancement: Amend last commit #1644

Closed

Description

@1pete

Description

Amend last commit feature is very useful and exists in many git clients, but not in GitHub Desktop.
It would be nice if we have it in GitHub Desktop too.

Current workaround is click Undo and commit again but I've to carefully check what I want to commit again.

Version

GitHub Desktop version: 0.5.5

Thanks.

Activity

  1. xt0rted commented on May 19, 2017

    @xt0rted
    Contributor

    I typically commit the missed/extra changes and then rebase & squash, this would certainly speed that process up.

  2. joshaber commented on Jun 29, 2017

    @joshaber
    Contributor

    Thanks for the suggestion!

    This idea is interesting for the future, but this is beyond the scope of our current roadmap.

    I'm going to add the future-proposal label to this issue and close it out, so that we don't get overwhelmed with our backlog! We'll revisit these as part of our next planning session.

  3. levinit commented on Sep 21, 2017

    @levinit

    useful function

  4. meyer commented on Jan 19, 2018

    @meyer

    @joshaber do you all accept PRs for features outside the current roadmap?

  5. j-f1 commented on Jan 19, 2018

    @j-f1
    Contributor

    @desktop/design Does this need some design 💭?

    If not, feel free to go ahead, @meyer.

  6. shiftkey commented on Jan 19, 2018

    @shiftkey
    Member

    Please hold off on this. We haven't had a chance to evaluate these proposals, and I'm pretty sure this needs some design thought. @meyer if you have thoughts on how this should look/feel/behave feel free to share them in here as a starting point.

  7. DanTup commented on Mar 20, 2018

    @DanTup

    I find myself really often committing things with the message "f" as a reminder to rebase -i and mark as fixup later. Sometimes I forget and I push these changesets :(

    Would be good to see this - maybe a tickbox near the commit button for "Amend last commit" - ticking it should allow committing without entering a summary/description (or ticking it could pre-fill the previous messages if the fields are blank, for easier typo-correction).

    Oh, and show a warning if the previous changeset may have been pushed ;-) (I'm not sure if Git has any equiv of Mercurial's phases?)

  8. JaneSmith commented on Mar 30, 2018

    @JaneSmith

    For what it's worth, the three major reasons I use SourceTree instead of GitHub Desktop whenever possible are:

    1. Multi-file selection (for discarding, staging, etc.).
    2. Branch relationship visualisation.
    3. Amend last commit.

    The first is apparently being worked on already in a pull request, and hopefully will be in GitHub Desktop soon. The second one is kind of on the roadmap, although perhaps not in the form I want (a visual graph). That leaves the last one. Being able to quickly and easily amend the last commit is very useful to me.

  9. phuibonhoa commented on May 30, 2018

    @phuibonhoa

    I use amend all the time on Gitx and really miss it when I've tried to swap to GHD.

    They have an amend checkbox, if you check it:

    • the previous commit message shows up in the commit message box to edit
    • any changes in the previous commit are now in the staged state

    Because things are by default not staged in Gitx this works well. You can add / remove stuff as needed. Since things default to staged on GHD, it presents a problem since it might be hard to tell what was part of the commit previous commit and what are new changes.

    fo_on_o

  10. cdmihai commented on Aug 13, 2018

    @cdmihai

    I often (several times per day) fixup the previous commits, and I use git commit --fixup and rebase -i --autosquash to quickly do it. Having UI support for this would be really helpful.

    This is a generalization of git commit --amend. Rather than fixing up the latest commit, the UI client could have an option to choose an arbitrary commit to fixup. The UI could make amending the last commit the fast UI option, and then require some extra click to get to fixing up any commit.

  11. billygriffin commented on Nov 14, 2018

    @billygriffin
    Contributor

    From #5953 (comment):

    While not directly related to inter-branch rebasing described [in that issue], the fixup/amend (#1644) feature request may be a great addition to the larger rebase workflows being considered.

    At the very least, could we consider re-opening that issue as part of the larger re-prioritization of the milestone?

  12. digitalmaster commented on Apr 14, 2020

    @digitalmaster
    Contributor

    Amending last commit is a pretty standard part of my workflow (usually before pushing my branch). Would be awesome to be able to just "add changes to last commit".

  13. 21 remaining items

  14. billygriffin commented on Mar 16, 2021

    @billygriffin
    Contributor

    @sdegutis Here's some historical context on staging: #4408 (comment)

    But as I mentioned, we're not planning to revisit that decision anytime soon and this issue is unrelated to that. Please let me know if you'd like to look into exploring the technical aspects of preserving the state you were in prior to a commit as part of "Undo."

  15. sdegutis commented on Mar 16, 2021

    @sdegutis

    Thanks for the link, and sure.

  16. sdegutis commented on Mar 16, 2021

    @sdegutis

    I think there is a lot of value in this feature, however it is implemented.

    That said, I'm less confident it'll be as quick as I estimated before, knowing that reinventing portions of git inside the app is potentially required.

    But more importantly, I'm less enthusiastic about helping to improve what I now see is a git client whose caveats show that it favors non-technical users, which mostly excludes me from its target audience.

  17. billygriffin commented on Mar 16, 2021

    @billygriffin
    Contributor

    That's totally fine @sdegutis, no worries if you'd prefer not to work on it. GitHub Desktop is used daily by a ton of people, both technical and non-technical, but it's definitely a more opinionated design, and that isn't always going to align with the preferences of everyone. We genuinely want people to use the tools that work best for them to build awesome stuff on GitHub.

  18. sdegutis commented on Mar 16, 2021

    @sdegutis

    Like I said, I'm not opposed to working on it, I'm just not as enthusiastic or confident as before. And I'm not entirely outside the target audience, either, as I'm so far using it in place of Magit with acceptable success.

    But I'm still convinced your design decision doesn't even help your own goal. If you compare the outcomes of both sides of the decision, non-technical users have no disadvantage to the git index being changed invisibly behind the scenes for them, and technical users have the ability for Github Desktop to work in conjunction with other apps, e.g. Terminal or VS Code.

    That's the only reason I'm still mentioning this. But now that I think I've explained it as clearly as I can both here and in #4408 , I feel comfortable dropping the topic. Thanks for your time and patience in reading my feedback and communicating about these questions and concerns.

  19. rsodre commented on Mar 16, 2021

    @rsodre

    Hi @sdegutis, thanks for the response. Because this is excluded to the last commit, I think we'd want to consider this as part of the existing "Undo" functionality and make it a more proper "Undo" that preserves the state you were in prior to making the commit.

    I think Amend and Undo are two completely different things. By undoing, I understand to erase the last commit, there's a git command for that (git reset), which could also be supported. That's good!

    But Amend is used to add something else to the previous commit. I often commit 10 files, and while working on the next feature, I have already 10 more files edited, and find something would fit better on the last commit. Amend allows me to just insert that one small fix to it. If I undo the last commit just for that, now I have 10 previously commited files with 10 new ones, all on the same place. I've done that, and that's chaos, please don't mix those two concepts!

    I understand having an Undo feature is good for people uninitiated with git, but don't agree with this approach. Instead of creating a new workflow and inserting git concepts in it, we should try to make already stablished git concepts and workflows user-friendly. Having separated Undo and Amend make things clearer for experienced users, without over-complicate things. Let new users learn git, easily, without noticing!

  20. sdegutis commented on Mar 16, 2021

    @sdegutis

    Let new users learn git, easily, without noticing!

    In fact, one cool feature would be to have hover-tooltips that show the exact command a button would perform behind the scenes, so users can learn how to do the same thing with CLI if ever needed.

  21. sdegutis commented on Mar 24, 2021

    @sdegutis

    After trying out Github Desktop for a week or two, I'm convinced I'm not part of the target audience, and given the conflation of high-level and low-level concepts, I'm not sure who the target audience is. But in any case, I have to unfortunately withdraw my offer to help with this app. But it will be interesting to see how this app sparks and encourages competition in Git GUIs.

  22. rakhmanov commented on Apr 29, 2021

    @rakhmanov

    I think it cold be done elegantly by adding a button chevron on the Commit button.
    If you think it is still will confuse a user, make those options enabled through configuration with something like "enable advance commit options" which will enable the chevron with drop down menu on the commit button which can house additional options like "amend previous commit"

  23. goyalyashpal commented on May 26, 2021

    @goyalyashpal

    Moving over my input from #12283


    Describe the feature or problem you’d like to solve

    Sometimes a bad change in local repo might be mistakenely committed.
    To avoid them being pushed, currently, it seems that only option is to delete the repository. Which feels like a nuclear option imo.

    Proposed solution

    Ability to delete/remove local non-pushed commits

    How will it benefit Desktop and its users?

    In the above problem, this will be a life savour if there is big sized project.

    Additional context

    Add any other context like screenshots or mockups are helpful, if applicable.


    For ux suggestion:

    1. it slips from the view. as it seems to be sticking in the ui boundaries. the padding from bottom can be improved to make it more vertically center aligned.
      gimp-2 10_BIYUlegY6l

    2. views on giving the undo button there??
      GitHubDesktop_T7VvfuY6Jv


    also, the undo-ing doesnt work well in case there are commits after the wrong commit.

  24. VorTechnix commented on Jun 3, 2021

    @VorTechnix

    ...GitHub Desktop is used daily by a ton of people, both technical and non-technical, but it's definitely a more opinionated design, and that isn't always going to align with the preferences of everyone. We genuinely want people to use the tools that work best for them to build awesome stuff on GitHub.

    I stumbled on this issue because i found myself needing this feature (amend) this morning. As someone who started using Desktop as a non-technical user, having become a technical user over time I find it sad that the more I learn about "real" git the more I grow out of Desktop.

    In any case thanks to the developers for making Desktop, it really served me well as a new GitHub user. Not going to lie I'm off to look for alternative now but I'll try to keep checking back for when this feature (and hopefully interactive rebasing) are added.

  25. sergiou87 commented on Jun 3, 2021

    @sergiou87
    Member

    Thanks for your feedback!

    In case you're interested, we're actively working on adding "amend" to the app: #12353

    And regarding interactive rebase, squashing is already available in beta (#12235) and reordering commits will be Soon™ (#12299).

  26. VorTechnix commented on Jun 3, 2021

    @VorTechnix

    Thanks for the heads up and for your work on this.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions