-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset local branch with the remote branch. #395
Comments
Hi @alexisfrjp, Thanks for this feature request, this would be great to have in Git Graph! |
…Dialog, allowing any local branch (that's not checked out) to be reset to the remote branch.
I've explored numerous Git commands (and combinations of commands) that have the affect of resetting a local branch with a remote branch, while handling "remote branch has been force pushed and/or my local branch has changes". Each option has various subtle nuances and pro's & con's, however I believe I've implemented the option with the most net value for users (across many different workflows - not just the one specifically mentioned in this feature request). From the remote branch context menu, the "Fetch into local branch..." action now has the option to "Force Fetch", which when enabled has the affect of "Force the local branch to be reset to this remote branch.". The only limitation is that the local branch can't be checked out when doing the Force Fetch, as most Git commands won't allow the checked out branch to be force updated. In the use case you mentioned, I believe you would:
Please try out the implemented solution, and let me know if it works for your use case. If you don't think the implemented solution is workable, I'm more than happy to explore alternatives and implement them as well (as long as I haven't ruled it out for some reason). This will be available in v1.30.0. If you'd like to use it before the next release, you can download v1.30.0-beta.0, and install it following the instructions provided here. |
Hello, I didn't want to open a new issue thus commenting here. Resetting my current local branch on the remote is something I do very frequently. As this is not directly possible my work around is right-clicking the commit instead of the branch and then do the reset.
Could you explain this a little more? As I see it, a remote branch is no different to a local branch. This is even more clear as you can easily reset/rebase on the commit the remote branch is pointing to. So why shouldn't you be able to do it on the branch. (I'm referencing to rebasing on remote branches which I also often do. #329) Resetting to the tracking remote branch in the command line would be done with.
But it could as well be done with the full branch name which also works for any remote branch
|
During a checkout from a remote branch, I'd like to be able to overwrite/reset the local branch with the remote branch. The remote branch has been force pushed and/or my local branch has changes not committed/stashed, then choosing
Checkout the existing branch & pull changes
will just lead to merge conflicts.Gitkraken has a feature
Reset Local to Here
when I want to checkout a branch.I'd like to slowly replace GitKraken/GitAhead with a single tool such as Git Graph.
The text was updated successfully, but these errors were encountered: