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
Differentiating commits in history between local-only and remote #5873
Please 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. Using git rebase with the reword option is a simple solution, but it seems like GitHub Desktop could provide this functionality natively.
Reacted by cypress evelyn masso, Ronnie Dutta, Erik McDaniel, darkred and 小蛮腰2025
Hi @dsanders11, thanks for the idea! I also agree that the distinction between local and remote can be confusing as a general problem with Git and that we might be able to do some subtle things to improve that differentiation for people. Reading through the proposed solutions, it feels like only the first one is tied to the problem laid out above. Would you mind also including what problems 2 and 3 are solving to help align on further discussion?
Reading through the proposed solutions, it feels like only the first one is tied to the problem laid out above.
The title might be better served replacing the word view with functionality. As I started to lay this out I had other thoughts on the functionality of local commits, beyond the initial visual difference.
Would you mind also including what problems 2 and 3 are solving to help align on further discussion?
Well, 2 is making 'Undo' for local commits into more of a nicely supported feature. It's currently a bit strange how it is shoehorned in to the bottom of the Changes tab, since it's the only thing on that tab which shows commits, everything else commit related is under the History tab. As such I was on the History tab looking at those commits, and wanted to undo the last one. The only option there currently is for revert, which isn't what I want since that actually creates a new commit. So it seems logical that the 'Undo' for local commits would be accessible from the History tab as well.
As I mentioned on 3, the problem it is solving is wanting to change the commit message after making a local commit that hasn't been pushed to the remote yet. One of the benefits of having local commits is that you can still change them (with git rebase) before you push them to the remote.
There's other possible functionality that I was musing with in my head but didn't put in the original description, mostly around bringing more git rebase functionality in for local commits. Again, the benefit of having unpushed local commits is you can tweak them before pushing. Committing often is useful during development, but you often want to squash multiple commits down to a single commit before pushing. If the History tab let you select multiple commits, you could accomplish this by selecting those local commits and right-click 'Combine commits' or something similar. It gets trickier to handle some of the more advanced git rebase functionality (such as dropping commits, changing commit order, etc) in the History tab, but some limited functionality could be added without too much strain.
Thanks for the explanation @dsanders11. I'm going to update this issue title to focus on the initial problem described. Except for larger initiatives, we try to keep issues constrained to one problem at a time so it's clear how the problem relates to the potential solutions discussed. We're discussing 2 and 3 internally, but if you'd like to open separate issues for those, you're welcome to do so.
From the beginning, the problem as I understand it is:
It's difficult to visually determine which commits are only local and need to be pushed vs. which commits are also already on the remote.
changed the title [-]Improve View of Local Commits in History[/-][+]Differentiating commits in history between local-only and remote[/+]on Oct 11, 2018
I agree it would be really valuable to have a visual indication what commits have been pushed or not! I'm not sure off the top of my head what indicator we would use exactly, since we use the blue dot for "uncommitted." Maybe a ⬆️? Or something other than an icon?
I agree it would be really valuable to have a visual indication what commits have been pushed or not! I'm not sure off the top of my head what indicator we would use exactly, since we use the blue dot for "uncommitted." Maybe a ⬆️? Or something other than an icon?
I think @ampinsk's suggestion of using an ⬆️is more successful because it's aligned with what we show in the "Push/Pull/Fetch" button:
I'm a fan of going with this ⬆️ icon on local commits, borrowing from the visual language in the Push button and the repo indicators. Does this make sense to folks?
@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.
Activity
billygriffin commentedon Oct 11, 2018
Hi @dsanders11, thanks for the idea! I also agree that the distinction between local and remote can be confusing as a general problem with Git and that we might be able to do some subtle things to improve that differentiation for people. Reading through the proposed solutions, it feels like only the first one is tied to the problem laid out above. Would you mind also including what problems 2 and 3 are solving to help align on further discussion?
dsanders11 commentedon Oct 11, 2018
The title might be better served replacing the word view with functionality. As I started to lay this out I had other thoughts on the functionality of local commits, beyond the initial visual difference.
Well, 2 is making 'Undo' for local commits into more of a nicely supported feature. It's currently a bit strange how it is shoehorned in to the bottom of the Changes tab, since it's the only thing on that tab which shows commits, everything else commit related is under the History tab. As such I was on the History tab looking at those commits, and wanted to undo the last one. The only option there currently is for revert, which isn't what I want since that actually creates a new commit. So it seems logical that the 'Undo' for local commits would be accessible from the History tab as well.
As I mentioned on 3, the problem it is solving is wanting to change the commit message after making a local commit that hasn't been pushed to the remote yet. One of the benefits of having local commits is that you can still change them (with
git rebase) before you push them to the remote.There's other possible functionality that I was musing with in my head but didn't put in the original description, mostly around bringing more
git rebasefunctionality in for local commits. Again, the benefit of having unpushed local commits is you can tweak them before pushing. Committing often is useful during development, but you often want to squash multiple commits down to a single commit before pushing. If the History tab let you select multiple commits, you could accomplish this by selecting those local commits and right-click 'Combine commits' or something similar. It gets trickier to handle some of the more advancedgit rebasefunctionality (such as dropping commits, changing commit order, etc) in the History tab, but some limited functionality could be added without too much strain.billygriffin commentedon Oct 11, 2018
Thanks for the explanation @dsanders11. I'm going to update this issue title to focus on the initial problem described. Except for larger initiatives, we try to keep issues constrained to one problem at a time so it's clear how the problem relates to the potential solutions discussed. We're discussing 2 and 3 internally, but if you'd like to open separate issues for those, you're welcome to do so.
From the beginning, the problem as I understand it is:
It's difficult to visually determine which commits are only local and need to be pushed vs. which commits are also already on the remote.
[-]Improve View of Local Commits in History[/-][+]Differentiating commits in history between local-only and remote[/+]billygriffin commentedon Oct 11, 2018
I also think this is related to #5330 in that it relates to differentiating between things that you have locally that are not yet on remote.
Curious if @desktop/design has any thoughts about this.
ampinsk commentedon Oct 11, 2018
I agree it would be really valuable to have a visual indication what commits have been pushed or not! I'm not sure off the top of my head what indicator we would use exactly, since we use the blue dot for "uncommitted." Maybe a ⬆️? Or something other than an icon?
j-f1 commentedon Oct 12, 2018
Perhaps a small ☁️ icon with a ✓ overlayed on it like the
cloud-{up,down}loadOcticons?shiftkey commentedon Oct 18, 2018
We had an earlier issue about this behaviour #4645 which I'll add the screenshot from @r-pascal about the classic behaviour:
j-f1 commentedon Oct 19, 2018
Looking at that, how about a ☁️ icon with a slash through it indicating unpushed status?
donokuda commentedon Oct 19, 2018
I think @ampinsk's suggestion of using an ⬆️is more successful because it's aligned with what we show in the "Push/Pull/Fetch" button:
ampinsk commentedon Nov 28, 2018
I'm a fan of going with this ⬆️ icon on local commits, borrowing from the visual language in the Push button and the repo indicators. Does this make sense to folks?
billygriffin commentedon Nov 28, 2018
@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.
j-f1 commentedon Nov 28, 2018
Plus the icon could be turned into a button to support pushing individual commits in the future, which I think has been requested before.
binaryfunt commentedon Feb 10, 2019
Could have an indicator on the last pushed commit saying
origin/masterlikegit log --decoratedoes