Compare commits
1 Commits
74a805017a
...
f2b8731770
Author | SHA1 | Date | |
---|---|---|---|
f2b8731770 |
25
README.md
25
README.md
@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
A set of [Git][git] aliases which follow the idea "say what you mean" rather
|
A set of [Git][git] [aliases][aliases] which follow the idea "say what you mean"
|
||||||
than remember the plumbing term of a specific command.
|
rather than remembering the plumbing term of a specific command.
|
||||||
|
|
||||||
* `abandon` abandons all local changes leave a clean repository.
|
* `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 --`.
|
* `unstage` unstage staged changes, shorthand for `git reset -q HEAD --`.
|
||||||
* `squash` perform an interactive rebase to squash all commits since branching,
|
* `amend` amends the last commit, shorthand for `git commit --amend`.
|
||||||
shorthand for `git rebase -i --fork-point`.
|
* `fixup` prepare a fixup commit for use with `git rebase --autosquash`,
|
||||||
|
shorthand for `git commit --fixup=<commit>`.
|
||||||
|
* `squash` prepare a squash commit for use with `git rebase --autosquash`,
|
||||||
|
shorthand for `git commit --squash=<commit>`.
|
||||||
|
* `prepare` prepare a branch for merging into another, shorthand for
|
||||||
|
`git rebase --interactive --fork-point`.
|
||||||
* `list` list local branches, a shorthand for `git branch`.
|
* `list` list local branches, a shorthand for `git branch`.
|
||||||
* `create` creates a new branch, shorthand for `git checkout -b`.
|
* `create` creates a new branch, shorthand for `git checkout -b`.
|
||||||
* `delete` deletes an existing branch, shorthand for `git branch -D`.
|
* `delete` deletes an existing branch, shorthand for `git branch -D`.
|
||||||
@ -31,4 +35,15 @@ than remember the plumbing term of a specific command.
|
|||||||
`HEAD` has the subject `temp!` then `git reset --mixed HEAD~` is executed,
|
`HEAD` has the subject `temp!` then `git reset --mixed HEAD~` is executed,
|
||||||
otherwise the message `error: commit subject is not: temp!` is output.
|
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
|
[git]: https://git-scm.com
|
||||||
|
[aliases]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases
|
||||||
|
[zsh]: https://www.zsh.org
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#compdef git-changes
|
#compdef git-changes
|
||||||
#description Compare changes on this branch with another.
|
#description Compare changes on this branch with another.
|
||||||
|
|
||||||
_arguments \
|
_arguments '1: :__git_remote_branch_names_noprefix'
|
||||||
'1: :__git_remote_branch_names_noprefix'
|
|
||||||
|
|
||||||
# vim: ft=zsh
|
# vim: ft=zsh
|
||||||
|
10
config
10
config
@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
abandon = !git reset --hard HEAD && git clean -d -f
|
abandon = !git reset --hard HEAD && git clean -d -f
|
||||||
amend = commit --amend
|
|
||||||
unstage = reset -q HEAD --
|
unstage = reset -q HEAD --
|
||||||
squash = rebase -i --fork-point
|
|
||||||
|
amend = commit --amend
|
||||||
|
fixup = commit --fixup
|
||||||
|
squash = commit --squash
|
||||||
|
prepare = rebase -i --fork-point
|
||||||
|
|
||||||
list = branch
|
list = branch
|
||||||
create = checkout -b
|
create = checkout -b
|
||||||
@ -49,6 +52,9 @@
|
|||||||
[push]
|
[push]
|
||||||
default = simple
|
default = simple
|
||||||
|
|
||||||
|
[rebase]
|
||||||
|
autoSquash = true
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
useConfigOnly = true
|
useConfigOnly = true
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user