Browse Source

git: Реорганизован gitconfig

Maxim Likhachev 6 years ago committed by Maxim Likhachev
parent
commit
7d5cbf13af
  1. 105
      etc/soft/git/gitconfig

105
etc/soft/git/gitconfig

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
editor=nvim
excludesfile = ~/.shellrc/etc/soft/git/gitignore-global
quotepath = false
commitGraph = true
[gui]
wmstate = normal
@ -25,60 +26,100 @@ @@ -25,60 +26,100 @@
[credential]
helper = cache --timeout=3600
[push]
default = simple
[gc]
writeCommitGraph = true
[alias]
# ----[ COMMON ]--------------------------------------------------------
br = branch #noindex
st = status #noindex
df = diff #noindex
# Коммит
ci = commit
# Коммит с сообщением
cm = commit -m
cr = commit --amend
cv = commit --verbose
recommit = commit --amend
df = diff
# Коммит от имени envrm
cma = commit --author 'Maxim Likhachev <envrm@yandex.ru>' -m
br = branch
cb = !git branch | grep "\\*"
# Коммит с отображением сохраняемых изменений
cv = commit --verbose
st = status
# Исправление последнего коммита
ca = commit --amend
p = pull
# git push в текущий origin
u = "!echo git push origin $(git rev-parse --abbrev-ref HEAD)"
# git push во все репозитории
up = "!git remote -v | awk '{ print $1 }' | uniq | xargs -IL echo git push L $(git cb | awk '{ print $2 }')"
co = checkout
# Корневая директория репозитория
root = rev-parse --show-toplevel
ld = log --source --stat --date=iso --pretty=medium -p
lf = log --source --graph --stat --date=iso --pretty=medium --decorate=full
ls = log --graph --pretty=format:'%Cred%h%Creset - %Cgreen[%cd]%Creset ::%C(yellow)%d%Creset %s %C(bold blue)<%ae>%Creset' --abbrev-commit --date=short
# Адрес удалённого репозитория
url = !git remote -v | grep fetch | awk '{ print $2 }'
# Упаковка репозитория в zip-архив
pk = !git archive HEAD --format=zip > `basename $PWD`_`\\date '+%Y.%M.%d'`.zip
# ----[ CLONE ]---------------------------------------------------------
# Клонирование репозитория code.envrm.info
my = "!git_clone() { git clone https://code.envrm.info/src/${1}.git; }; git_clone"
# Клонирование репозитория githube.com
hub = "!git_clone() { git clone git://github.com/${1}.git; }; git_clone"
# Клонирование репозитория notabug.org
nb = "!git_clone() { git clone https://notabug.org/${1}.git; }; git_clone"
# ----[ LOGS ]----------------------------------------------------------
# Последний коммит
ll = !git --no-pager log -1 HEAD && echo
# Краткий список коммитов
ls = log --graph --pretty=format:'%Cred%h%Creset - %Cgreen[%cd]%Creset ::%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset' --abbrev-commit --date=short
# Полный журнал изменений
lf = log --source --graph --stat --date=iso --pretty=medium --decorate=full
# Список коммитов с выводом изменений
ld = log --source --stat --date=iso --pretty=medium -p
# Локальные изменения, готовые к отправке на сервер
lu = !git --no-pager log --left-right --pretty=format:'%C(yellow)%h%Creset - %Cgreen[%cd]%Creset :: %s %C(bold blue)%Creset' --abbrev-commit --graph --color --date=short origin/master...HEAD | nl
# Вывод дерева слияний
tree = ls --all --simplify-by-decoration
# ----[ EXTRA ]---------------------------------------------------------
# Интерактивный список своих коммитов
recall = !git-recall
alias = !sh -c '[ ! -z $2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -
aliases = !git config --get-regexp 'alias.*' | sed 's/alias.//' | sed 's/ / = /'
# Список наиболее часто изменяемых файлов
top = !git-top
# This produces output that can be displayed using dotty, for example:
# $ git graphviz HEAD~100..HEAD~60 | dotty /dev/stdin
# $ git graphviz --first-parent master | dotty /dev/stdin
# Note how defining a function eliminates the need to use sh -c.
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '\n}'; }; f"
# Список псевдонимов
aliases = !git-aliases
url = !git remote -v | grep fetch | awk '{ print $2 }'
# Создание графа коммитов
graphviz = !git-graphviz
# The last forks of current or specified github repository
forks = "!f() { [ -z "$1" ] && forks $(git url | grep github.com | sed -e 's|^.*github.com/||' | sed 's/.git.*$//') || forks "$1"; }; f"
# Список форков, отсортированный по дате последнего изменения
forks = !git-forks
hub = "!git_clone() { git clone git://github.com/${1}.git; }; git_clone"
nb = "!git_clone() { git clone https://notabug.org/${1}.git; }; git_clone"
my = "!git_clone() { git clone https://code.envrm.info/src/${1}.git; }; git_clone"
# Получение ignore-шаблонов с https://gitignore.io/
ignore = !git-ignore
# Календарь изменений
calendar = !git-cal
pk = !git archive HEAD --format=zip > `basename $PWD`_`\\date '+%Y.%M.%d'`.zip
# https://gitignore.io/
ignore = "!ignore() { curl -sq gitignore.io/api/${1} | grep -v '^#' | grep .; }; ignore"
[push]
default = simple

Loading…
Cancel
Save