Add aliases for working with autosquash rebases
* Rename the `squash` alias to `prepare` to repurpose it. * Change `squash` alias to `git commit --squash=<commit>`. * Add `fixup` alias to `git commit --fixup=<commit>`. * Set the `rebase.autoSquash` config option to `true`.
This commit is contained in:
23
README.md
23
README.md
@@ -2,14 +2,16 @@
|
||||
|
||||
## Aliases
|
||||
|
||||
A set of [Git][git] aliases which follow the idea "say what you mean" rather
|
||||
than remember the plumbing term of a specific command.
|
||||
A set of [Git][git] [aliases][aliases] which follow the idea "say what you mean"
|
||||
rather than remembering the plumbing term of a specific command.
|
||||
|
||||
* `abandon` abandons all local changes leave a clean repository.
|
||||
* `amend` amends the last commit, shorthand for `git commit --amend`.
|
||||
* `unstage` unstage staged changes, shorthand for `git reset -q HEAD --`.
|
||||
* `squash` perform an interactive rebase to squash all commits since branching,
|
||||
shorthand for `git rebase -i --fork-point`.
|
||||
* `amend` amends the last commit, shorthand for `git commit --amend`.
|
||||
* `fixup` prepare to fixup a commit, shorthand for `git commit --fixup`.
|
||||
* `squash` prepare to squash a commit, shorthand for `git commit --squash`.
|
||||
* `prepare` prepare a branch for merging into another, shorthand for
|
||||
`git rebase --interactive --fork-point`.
|
||||
* `list` list local branches, a shorthand for `git branch`.
|
||||
* `create` creates a new branch, shorthand for `git checkout -b`.
|
||||
* `delete` deletes an existing branch, shorthand for `git branch -D`.
|
||||
@@ -31,4 +33,15 @@ than remember the plumbing term of a specific command.
|
||||
`HEAD` has the subject `temp!` then `git reset --mixed HEAD~` is executed,
|
||||
otherwise the message `error: commit subject is not: temp!` is output.
|
||||
|
||||
## Zsh Completions
|
||||
|
||||
The excellent [Git][git] completions provided by [Zsh][zsh] which can see
|
||||
through [aliases][aliases] however some aliases involve multiple commands or
|
||||
rely on the shell to function. The following aliases extend the default
|
||||
[Git][git] completions.
|
||||
|
||||
* `git changes` completions for the branch name to compare with are provided.
|
||||
|
||||
[git]: https://git-scm.com
|
||||
[aliases]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases
|
||||
[zsh]: https://www.zsh.org
|
||||
|
||||
Reference in New Issue
Block a user