forked from keis/git-fixup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
53 lines (38 loc) · 1.59 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
git-fixup
=========
Fighting the copy-paste element of your rebase workflow.
`git fixup <ref>` is simply an alias for `git commit --fixup <ref>`. That's
just a convenience feature that can be also be used to trigger tab completion.
The magic is in plain `git fixup` without any arguments. It finds which
lines/files you have changed, uses git blame/log to find the most recent commits
that touched those lines/files, and displays a list for you to pick from. This
is a convenient alternative to manually searching through the commit log and
copy-pasting the commit hash.
Install
-------
make install
make install-zsh
-or-
Copy the program and completion script into your $PATH and $fpath respectively.
Usage
-----
For this tool to make any sense you should enable the rebase.autosquash setting
in the git config.
.. change stuff and discover something that calls for a fixup!
$ git add -p
select the changes that should be part of the fixup
$ git fixup
outputs a list of commits that the staged changes are likely a fixup of
$ git fixup <ref>
create a fixup!-commit of the given ref, if you have installed the
zsh script you can cycle through the list of fixup candidates with tab
completion.
$ git rebase -i ...
commit rebased into the selected commit as a fixup
Tab completion
--------------
The suggestions for the tab completion is the suggested fixup bases as
generated by running the tool without any arguments.
To be able to tab complete the command itself add a line like this to your zsh
configuration::
zstyle ':completion:*:*:git:*' user-commands fixup:'Create a fixup commit'