git/config
Kenneth Benzie (Benie) f2b8731770 Add aliases for working with autosquash rebases
* Rename the `squash` alias to `prepare` to repurpose it.
* Change `squash` alias to `git commit --squash=<commit>`.
* Add `fixup` alias to `git commit --fixup=<commit>`.
* Set the `rebase.autoSquash` config option to `true`.
2018-08-13 12:15:13 +01:00

64 lines
1.4 KiB
Plaintext

# vim: ft=gitconfig
[alias]
abandon = !git reset --hard HEAD && git clean -d -f
unstage = reset -q HEAD --
amend = commit --amend
fixup = commit --fixup
squash = commit --squash
prepare = rebase -i --fork-point
list = branch
create = checkout -b
delete = branch -D
name = rev-parse --abbrev-ref HEAD
last = !sh -c 'git reflog | grep \" checkout: moving from\" | head -n 1 | awk \"{ print \\$6 }\"'
checkout-last = !git checkout `git last`
publish = !git push -u origin `git name`
unpublish = !git push -u origin :`git name`
force = push --force-with-lease
changes = !sh -c 'git log --oneline $1..' --
tree = log --graph --abbrev-commit --oneline --decorate \
--format=format:'%C(yellow)%h%C(reset) %C(blue)%aD%C(reset) %C(green)(%ar)%C(reset)%C(bold)%d%C(reset)%n %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
save = commit -am "temp!"
load = !sh -c '[ \"temp!\" = \"`git show --format=%s --no-patch`\" ] && \
git reset --mixed HEAD~ || echo \"error: commit subject is not: temp!\"'
[commit]
verbose = true
[core]
editor = vim
excludesfile = ~/.config/git/excludes
[fetch]
prune = true
[help]
autocorrect = -1
[merge]
tool = vimdiff
conflictstyle = diff3
prompt = false
[pager]
status = true
[push]
default = simple
[rebase]
autoSquash = true
[user]
useConfigOnly = true
[include]
path = ~/.config/private/gitconfig
path = ~/.config/work/gitconfig