jesseduffield / jesseduffield/lazygit

Edit a file from a commit *at the revision of the commit*

Open
#3,414 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**

I sometimes forget to run a formatter on my files before sending them to presubmit, causing presubmit to warn me about that.
Once I get the feedback from presubmit, I'm already a few commits in. Usually it's "just" adding a newline in a file. Going back to the
said revision just to add a newline is possible today with git (of course), but it's very laborious to do. It would save me tremendous
amount of time if I could navigate to the commit/file combo, and edit in place. The `e` command allows editing that file, but the
edit is at HEAD, which is not what I'd like.

**Describe the solution you'd like**
Allow me to modify the hunk in the commit/file by adding edits.

**Describe alternatives you've considered**
Manually doing the above.

It's something like: grow a branch from the commit I want to edit, check that commit out, do the edit, commit amend, rebase the remainder on top of this, being careful not to duplicate changes.
Remove the temporary branch.

Maybe this functionality exists, but I missed it?

**Additional context**
N/A

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.