mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Update user doc
This commit is contained in:
parent
b82c72b63d
commit
c9c556beba
1 changed files with 7 additions and 19 deletions
|
@ -56,22 +56,10 @@ base commit in the Commits view automatically. From there, you can either press
|
||||||
shift-F to create a fixup commit for it, or shift-A to amend your changes into
|
shift-F to create a fixup commit for it, or shift-A to amend your changes into
|
||||||
the commit if you haven't published your branch yet.
|
the commit if you haven't published your branch yet.
|
||||||
|
|
||||||
This command works in many cases, and when it does it almost feels like magic,
|
If you have many modifications in your working copy, it is a good idea to stage
|
||||||
but it's important to understand its limitations because it doesn't always work.
|
related changes that are meant to go into the same fixup commit; if no changes
|
||||||
The way it works is that it looks at the deleted lines of your current
|
are staged, ctrl-f works on all unstaged modifications, and then it might show
|
||||||
modifications, blames them to find out which commit those lines come from, and
|
an error if it finds multiple different base commits. If you are interested in
|
||||||
if they all come from the same commit, it selects it. So here are cases where it
|
what the command does to do its magic, and how you can help it work better, you
|
||||||
doesn't work:
|
may want to read the [design document](dev/Find_Base_Commit_For_Fixup_Design.md)
|
||||||
|
that describes this.
|
||||||
- Your current diff has only added lines, but no deleted lines. In this case
|
|
||||||
there's no way for lazygit to know which commit you want to add them to.
|
|
||||||
- The deleted lines belong to multiple different commits. In this case you can
|
|
||||||
help lazygit by staging a set of files or hunks that all belong to the same
|
|
||||||
commit; if some changes are staged, the ctrl-f command works only on those.
|
|
||||||
- The found commit is already on master; in this case, lazygit refuses to select
|
|
||||||
it, because it doesn't make sense to create fixups for it, let alone amend to
|
|
||||||
it.
|
|
||||||
|
|
||||||
To sum it up: the command works great if you are changing code again that you
|
|
||||||
changed or added earlier in the same branch. This is a common enough case to
|
|
||||||
make the command useful.
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue