make my current local branch exactly match its remote counterpart #5771
marc0janssen
started this conversation in
Ideas
Replies: 2 comments 2 replies
|
This is available for the currently checked out branch; to access it, you need to focus the Files panel (that's a bit unintuitive, admittedly) and press |
2 replies
|
Thanks for explaining and helping me out!!Verstuurd vanaf mijn iPhoneOp 8 jul 2026 om 11:54 heeft Stefan Haller ***@***.***> het volgende geschreven:
All the shift-D options reset to the current HEAD; g is different because it resets to a different commit. For that reason I'd like to keep them separate.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I’d like a way in Lazygit to make my current local branch exactly match its remote counterpart.
In other words, I want to discard all local changes and any local-only commits, then reset the current branch to the latest version from
origin.The Git equivalent would be something like:
git fetch origin && git reset --hard origin/$(git branch --show-current)Ideally, this could be exposed as a clear action in Lazygit, for example:
“Reset local branch to remote”
A confirmation prompt would be important, as this is a destructive action and would discard local changes and commits that have not been pushed.
My use case is simple: sometimes I no longer need the local state and just want to overwrite it completely with the remote version of the same branch, without having to leave Lazygit or manually type the Git commands.
It would be great if this action clearly showed which local branch and remote branch are involved before confirming the reset.
Thanks,
Marco
All reactions