Skip to content

[FEATURE] Checkout commit without having to creating local branch #75

Description

@phatnv-geargames

1. Background

Currently, there seems no way to checkout a commit if there is any branch on that commit.
This UX will give some of the problems

  1. If the local branch on a newer commit than its remote tracking branch, I cannot checkout the commit of remote tracking branch. It notifies checkedOut but there is no change. (screenshot 1)
  2. If the local branch on an older commit than its remote tracking branch (reset hard local branch to older commit), when I want to checkout the commit of local branch (older commit) (just to delete that branch without having to changing my commit), it show the Checkout and Fast-Forward popup to fast-forward this local branch to its remote tracking branch. And it is not what I want to do. (screenshot 2)
  3. To check the repo state at some commits which have any remote branch points to, I can't checkout the commit itself. Instead the graph shows Checkout remote branch popup, and I'm forced to create a local branch to what I want (screenshot 3). For large repository, this action could pollute the repo with multiple unused local branches later on and to clean them up with take effort.

I would think there are more problems without this UX, but that's just it for now.

2. Proposed Solution

  1. It seems like a bug
  2. Show the Checkout popup (screenshot 4) instead of Checkout and Fast-Forward popup when users use Checkout Commit context menu at a commit that current branch points to. If users want to fast-forward, they could double-click the remote tracking branch
  3. Show the Checkout popup (screenshot 4) instead of Checkout remote branch popup when users use Checkout Commit context menu at a different commit that has any remote branch. If users want to checkout a remote branch, they could open the context menu at the desired commit, select the remote branch in the context menu and select Checkout.

3. Affected Area

Check all that apply.

  • Commit graph (Graph View)
  • Commit details panel (Bottom Panel)
  • Sidebar (Branches / Remotes / Tags / Stashes / Worktrees)
  • Toolbar (Fetch / Pull / Push / Refresh)
  • Context menu
  • Search
  • Statistics view (Stats)
  • Activity Log
  • i18n (localization)
  • Git operations (new Git command support)
  • Other

4. Alternatives or References

I'm coming from Git Graph of mhutchie, and the mentioned UX is default in there. So it could be a reference.

5. Additional Context (optional)

Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions