Dotfiles.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

258 lines
7.7 KiB

[user]
name = Maxim Likhachev
email = envrm@yandex.ru
[includeIf "gitdir:~/FILES/Work/"]
path = ~/.gitconfig-work
[init]
defaultBranch = master # WLM
[core]
# pager = "less -R -X --ignore-case -w --jump-target=.5"
pager = delta
editor=nvim
excludesfile = ~/.shellrc/etc/soft/git/gitignore-global
hooksPath = ~/.shellrc/etc/soft/git/hooks/common/
quotepath = false
commitGraph = true
autocrlf = input
safecrlf = warn
askpass =
[fetch]
prune = true
[commit]
template = ~/.shellrc/etc/soft/git/templates/common/commit.txt
[gui]
wmstate = normal
geometry = 1278x971+1+22 212 188
[color]
ui = true
[pull]
ff = only
[merge]
conflictstyle = diff3
tool = vimdiff
[help]
autocorrect = 1
[credential]
helper = cache --timeout=3600
[push]
default = simple
[gc]
writeCommitGraph = true
[blame]
coloring = repeatedLines
[color "blame"]
repeatedLines = yellow
[status]
showUntrackedFiles = all
# ----[ DIFF METHODS ]--------------------------------------------------------
[diff]
renameLimit = 10240
colorMoved = default
[diff "plist"]
textconv = plutil -p
[diff "pdf"]
textconv = pdfinfo
[diff "png"]
textconv = exiftool
[diff "jpg"]
textconv = exiftool
[delta]
commit-style = box
file-style = box
light = true
navigate = true
syntax-theme = "OneHalfLight"
side-by-side = false
[interactive]
diffFilter = delta --color-only
# ----[ ALIASES ]--------------------------------------------------------
[alias]
# ----[ COMMON ]--------------------------------------------------------
br = branch #noindex
st = status #noindex
ss = -c color.status=always status --branch --short #noindex
df = diff #noindex
wc = diff --stat #noindex
# Коммит
ci = commit
# Коммит с сообщением
cm = commit -m
# Добавление изменений в последний коммит
cmadd = commit --amend --no-edit
# Обновить дату последнего коммита
cmtouch = commit --amend --no-edit --date=now
# Коммит от имени envrm
cma = commit --author 'Maxim Likhachev <envrm@yandex.ru>' -m
# Коммит с отображением сохраняемых изменений
cv = commit --verbose
# Исправление последнего коммита
ca = commit --amend
# Blame с подсветкой синтаксиса
cblame = !git-cblame
# Список diff-методов для сохранения в .gitattributes
diffs = "!grep '\\[diff \"' ~/.gitconfig | cut -d '\"' -f 2 | awk '{ print \"*.\" $0 \" diff=\" $0 }'"
# (c) https://stackoverflow.com/a/70727386
# Список файлов (ls -1) с git-статусом
dir = "!lsdir() { ( git status -s -- ':(glob)*'; \\ls -A --file-type | awk '{ print \" \"$0 }' ) | sort -t$'\n' -usk 1.4; }; lsdir"
# Список файлов (ls -1) с git-статусом
files = dir
attributes = diffs #noindex
# git push в текущий origin
u = "!echo \"# As $(git author)\n# to $(git url)\n\"; echo git push origin $(git rev-parse --abbrev-ref HEAD)"
# git force push в текущий origin
uf = "!echo \"# \\033[1;31m[ FORCE PUSH ]\\033[00m\n# As $(git author)\n# to $(git url)\n\"; echo git push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease"
# git push во все репозитории
up = "!git remote -v | awk '{ print $1 }' | uniq | xargs -IL echo git push L $(git rev-parse --abbrev-ref HEAD)"
# Корневая директория репозитория
root = rev-parse --show-toplevel
# Адрес удалённого репозитория
url = !git remote -v | grep fetch | awk '{ print $2 }'
# Упаковка репозитория в zip-архив
pk = !git archive HEAD --format=zip > `basename $PWD`_`\\date '+%Y.%M.%d'`.zip
# Настройка remote на code.envrm.info
my-remote = "!remote() { git remote add origin https://code.envrm.info/src/$(basename "$(pwd)").git; }; remote"
# Удаление принятых в master веток
cleanup = "!git branch --merged | grep -v '\\*\\|master' | xargs -n 1 git branch -d"
# ----[ 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 https://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 :: %s %C(bold blue)<%an>%Creset%C(yellow)%d%Creset' --abbrev-commit --date=short --color=always
# Краткий список коммитов без слияний
lss = ls --no-merges
# Краткий список коммитов с пиктограммами
li = !git lss | sed -E -e 's/Add /📗 /' -e 's/Fix /🐞 /' -e 's/(Improve|Adjust) /⚙ /' | less
# Полный журнал изменений
lf = log --source --graph --stat --date=iso --pretty=medium --decorate=full
# Список сообщений коммитов, сгруппированных по авторам
lm = shortlog -n -e -c
# Список коммитов с выводом изменений
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
# Список удалённых файлов
deleted = !git log --graph --oneline --diff-filter=D --summary
# Журнал действий со ссылками на коммиты
refs = reflog show
# Список последних действий в ветках
last = !git-recent
# Вывод дерева слияний
tree = ls --all --simplify-by-decoration
# Текущий пользователь
author = config --get user.email
# Текущий пользователь
user = config --get user.email
# Текущий пользователь
whoami = config --get user.email
# ----[ EXTRA ]---------------------------------------------------------
# Интерактивный список своих коммитов
recall = !git-recall
# Список наиболее часто изменяемых файлов
top-files = !git-top
# Список наиболее активных авторов
top-authors = !git shortlog -sn --all --no-merges
# Список наиболее активных авторов
top-users = !git shortlog -sn --all --no-merges
# Список псевдонимов
aliases = !git-aliases
# Создание графа коммитов
graphviz = !git-graphviz
# Список форков, отсортированный по дате последнего изменения
forks = !git-forks
# Получение ignore-шаблонов с https://gitignore.io/
ignore = !git-ignore
# Создание gitignore-файла на основе меток +GITIGNORE
makeignore = !git-makeignore
# Календарь изменений
calendar = !git-cal
# Информация о репозитории https://github.com/o2sh/onefetch
card = !onefetch
change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f"