jesseduffield / jesseduffield/lazygit

Does deleting the newest commit in lazygit is the same as git reset --hard HEAD~1?

Open
#2,426 6 comments 1 reaction 0 assignees View on GitHub
discussion
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Topic**
the version is 0.37
i have a git repo commit log like this, it's a tig show in nigthtly branch. I use tig snapshot because its log graph is clear.
![image](https://user-images.githubusercontent.com/2133400/217715790-dd1bf31e-0f25-412d-b3c8-0917f0cd49c9.png)
there is a master branch , i checkout nightly and feature1 branch from it. Then make a commit on nightly, make two commits on feature1, at last merge feature1 to nightly, no conflicts.

All the operations below is happened in nightly branch.
Then i just need to delete the top merge commit. so I delete it in lazygit by press `d` in commits pane. but the result is so confused.
![image](https://user-images.githubusercontent.com/2133400/217716607-be0c737f-0c05-4186-8caa-95e351d09204.png)
It deletes the merge commit and also the commit I did in nightly branch and cherry-pick 2 commits of feature1 to nightly. But I think it should only delete the merge commit as `git reset --hard HEAD~1` does.

**Your thoughts**
If it's not a bug , what the exactly delete commit means in lazygit?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.