77 lines
2.5 KiB
Plaintext
77 lines
2.5 KiB
Plaintext
[alias]
|
|
### Basic usage
|
|
|
|
# This is the alias description
|
|
# Descriptions can be multiline
|
|
# use: example "these" "are the parameters"
|
|
# see: this-is-the-alias-explanatory-url
|
|
# !# this an ignored comment line
|
|
; this line is not ignored (but could be in 'isComment()')
|
|
# !: here are linting options
|
|
# !# lint options are comma separated: show cmd, inline, pretty
|
|
example = !echo "this is the alias command"
|
|
|
|
|
|
### git-alias, directives
|
|
|
|
# use: usage param1 param2
|
|
# !# or 'usage:'
|
|
usage = !echo "show expected alias parameters in red"
|
|
# https://example.com
|
|
# !# or prefix with: 'see:', 'link:', 'url:', 'web:'
|
|
link = !echo "print url with light gray color"
|
|
|
|
|
|
### git-alias, lint options
|
|
|
|
# !: ignore
|
|
# this description is also ignored
|
|
ignored = !echo "this alias is completly ignored unless --all"
|
|
|
|
# !: hide, hide cmd, not cmd, no cmd, hide command, not command, no command
|
|
# this description is still printed
|
|
hide_cmd = !echo "hide command unless --all"
|
|
|
|
# !: show cmd, show command
|
|
show_cmd = !echo "always show command even if not inline"
|
|
|
|
# !: inline, singleline, single line
|
|
single_line = !echo "forces command inline regardless of how long the line is"
|
|
|
|
# !: newline, new line, multiline, multi line, not inline, no inline, not single line, not singleline, no single line, no singleline
|
|
multi_line = !echo "force line break before cmd"
|
|
|
|
# !: pretty, prettify
|
|
prettify = "!f() { echo \"force pretty print command\"; }; f"
|
|
|
|
|
|
## Simple aliases
|
|
|
|
fpull = pull --rebase
|
|
fpush = push --force --all
|
|
fpushtags = push --force --tags
|
|
# Replace an existing tag with new commit
|
|
# use: ftag v1.0 c9a...d87
|
|
ftag = tag -a -f
|
|
|
|
|
|
### Advanced ###
|
|
|
|
# List all contributers with email
|
|
authors = !"echo; git log --format='%aN <%aE>' | sort -u; echo;"
|
|
# Replace email information
|
|
# see: https://help.github.com/articles/changing-author-info/
|
|
# use: new-email "old email" "new name" "new email"
|
|
new-email = !"f() { git filter-branch -f --env-filter ' \
|
|
if [ \"$GIT_COMMITTER_EMAIL\" = \"'\"$1\"'\" ]; then \
|
|
export GIT_COMMITTER_NAME=\"'\"$2\"'\"; \
|
|
export GIT_COMMITTER_EMAIL=\"'\"$3\"'\"; \
|
|
fi;\
|
|
if [ \"$GIT_AUTHOR_EMAIL\" = \"'\"$1\"'\" ]; then \
|
|
export GIT_AUTHOR_NAME=\"'\"$2\"'\"; \
|
|
export GIT_AUTHOR_EMAIL=\"'\"$3\"'\"; \
|
|
fi' --tag-name-filter cat -- --branches --tags; }; f"
|
|
# Show this message (help: -h)
|
|
# !: ignore, inline
|
|
alias = !python3 /usr/local/bin/git-alias.py
|