Checkout at specific commit to local branch and rebase
Currently there are only two options - To detached HEAD and to a new branch, even though upstream branch is set for local.
Something similar to GitExtensions. With options to maintain changes or not.
I'm not sure I fully understand what you're trying to accomplish – You're double-clicking a commit that is the tip of a remote branch, right?
- If you want to reset your current branch to that commit (as I'm led to believe by your GitExtensions screenshot), you can right-click on the commit in the history and select "Reset HEAD to here". I could indeed add this as an option in the checkout dialog if that's useful.
- If you want to "check out" a remote branch, you must first create a local branch at that commit. In the checkout dialog, "Start new branch here" lets you create a new local branch (that optionally uses the remote branch as its upstream), and switch to that new branch.
Please let me know if that does what you need, or if something's missing/confusing – there might be room for improvement here.
- If you want to "check out" a remote branch, you must first create a local branch at that commit. In the checkout dialog, "Start new branch here" lets you create a new local branch (that optionally uses the remote branch as its upstream), and switch to that new branch.
But the local branch is already created. To keep local branch up-to-date with preferably changes. And at selected commit.
Let me try to retrace your use case so I can understand what you’re expecting to see:
- Your current branch already has an upstream branch
- Your current branch is behind the upstream, i.e. the upstream has some new commits
- You’re double-clicking the tip of the upstream branch in the commit history, which brings up the checkout dialog
- You expect the checkout dialog to suggest bringing the local branch up to date with the upstream (via fast-forward, merge, or reset)
Is this correct?
Yeah, something like this