Skip to content

Instantly share code, notes, and snippets.

@RaD
Last active September 27, 2021 09:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RaD/7a87411421ce68cf664f to your computer and use it in GitHub Desktop.
Save RaD/7a87411421ce68cf664f to your computer and use it in GitHub Desktop.
Git Global Config
[gui]
encoding = utf-8
[alias]
#visual = gitk
last = log -1 HEAD
st = status
shorty = status --short --branch
# git unstage - убрать всё из индекса (чтобы например добавить/закоммитить сначала что-то другое)
unstage = reset HEAD --
up = !(git add . && git stash && git pull --rebase >&2) | grep -v \"No local changes to save\" && git stash pop
# git in / git out — смотреть какие коммиты придут/уйдут перед выполнением pull/push
in = "!git remote update -p; git log ..@{u}"
out = log @{u}..
# git addremove - добавить в индекс новые файлы/изменения и удалить всё что удалилось
addremove = !git add . && git ls-files --deleted | xargs --no-run-if-empty git rm
# git backup - заархивировать весь локальный репозиторий перед экспериментированием
backup = !file=../`git describe`.tar && echo \"Creating `readlink -f $file`\" && tar cf $file .
ci = commit
co = checkout
br = branch
bra = branch -a
chp = cherry-pick
pr = pull --rebase
please = push --force-with-lease
bl = blame -b -w
cia = commit --amend
cian = commit --amend --no-edit
rec = rebase --continue
sso = "show --stat --oneline"
lg = log --pretty=format:'%h was %an, %ar, message: %s' --graph
who = shortlog -s --
# Позволяет просматривать дерево коммитов в очень удобном виде.
gr = "log --all --graph --pretty=format:'%Cred%h%Creset%x09%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
gha = "log --graph --date=relative --all --topo-order --pretty=format:'%C(cyan)[%an]%Creset %C(green bold)%d%Creset %C(yellow)%h%Creset : %s %C(cyan)[%ad]%Creset'"
[color]
ui = true
[pull]
rebase = true
[core]
excludesfile = ~/.gitignore_global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment