dotfiles/home/.config/git/config
ItsDrike b2a32d8202
Add git alias to clone as bare repo
- This puts all of the git bare files into .bare and adds a .git file
  which specifies it's location. This makes for a nice and clean way to
  handle working with bare repositories
- Bare repositories are very useful since they allow for neat workflow
  by using git worktrees that can basically create folders for
  individual branches. This means we can easily check out given brach
  just by entering that folder and we don't need to worry about
  conflicting files which we'd have to stash and then apply the stash
  once we're done done.
2022-01-10 17:44:45 +01:00

76 lines
2 KiB
Plaintext

[user]
name = ItsDrike
email = itsdrike@protonmail.com
signingkey = FB8CA11A2CF3A843
[alias]
quickclone = "clone --single-branch --depth=1"
bareclone = "!sh -c 'git clone --bare \"$0\" \"$1\"/.bare; echo \"gitdir: ./.bare\" > \"$1/.git\"'"
m = "merge"
p = "push"
pl = "pull"
f = "fetch"
s = "status --short --branch"
ss = "status"
ch = "checkout"
chb = "checkout -b"
undo = "reset --soft HEAD~"
redo = "reset HEAD@{1}"
unstage = "restore --staged"
c = "commit"
ca = "commit --ammend"
ci = "commit --interactive"
cm = "commit --message"
cv = "commit --verbose"
a = "add"
aa = "add --all"
ap = "add --patch"
au = "add --update"
d = "diff"
dc = "diff --cached"
ds = "diff --staged"
dw = "diff --word-diff"
b = "branch"
ba = "branch --all"
bd = "branch --delete"
bD = "branch --delete --force"
bm = "branch --move"
bM = "branch --move --force"
l = "log --oneline --decorate --all --graph"
lp = "log --patch"
lo = "log --pretty=oneline --abbrev-commit --graph"
lg = "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
set-upstream = "!git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`"
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
[credential]
helper = store --file ~/.config/git/git-credentials
[core]
excludefile = ~/.config/git/global_gitignore
editor = nvim
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
line-numbers = true
[merge]
conflictstyle = diff3
[diff]
tool = vimdiff
[fetch]
prune = true
[commit]
gpgsign = true
[init]
defaultBranch = main