Differentiating commits in history between local-only and remote
See original GitHub issuePlease describe the problem you think should be solved Currently the history view displays local commits the same as synced commits, minus ‘View on Github’ being greyed out. This isn’t ideal as you can’t tell at a glance what is local and needs to be pushed, and the ‘undo’ feature isn’t accessible in the history view.
Do you have any potential solutions in mind? I’d suggest a few changes to improve how local commits are shown in the history tab:
-
Add a ‘This commit has not been pushed’ indicator somewhere, visually similar to the uncommitted changes indicator on the repository list. Possible implementations could be before the commit change message, at the end of it, or fixed in the upper right corner.
-
If the commit is local, and at the top of the commits list, swap ‘Revert This Commit’ with ‘Undo This Commit’ so that the undo feature is available on the history view. This is nicer than undoing commits from the changes tab where you don’t know how many are available to undo. I can’t think of a reason you’d want to revert the top-level local commit rather than just undoing it.
-
[Optional] This one is more work, but being able to edit the commit message of a local commit would be nice (I imagine under the covers that would be a
git rebase
which uses the reword option). I’ve definitely had cases where I have several local commits and I spot a typo in a commit message for one further back in the list. Usinggit rebase
with the reword option is a simple solution, but it seems like GitHub Desktop could provide this functionality natively.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:13 (12 by maintainers)
Top GitHub Comments
We had an earlier issue about this behaviour #4645 which I’ll add the screenshot from @r-pascal about the classic behaviour:
@ampinsk That seems reasonable to me. My only concern is potential conflation of informational vs. actionable in the icon. In the push button, the up arrow indicates that it’s an action you can take to push your commits up to the remote. But it seems to be working fine in the repo indicators, and those are informational, so that helps to mitigate my concern.
I’m just a bit worried that people might see those commits and think you can click on that button to push them up. Could be as simple as including a tooltip that says something like “This commit has not yet been pushed to your remote branch” or something along those lines. Or it’s possible I’m overthinking it.