-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
59 lines (59 loc) · 2.66 KB
/
.gitconfig
File metadata and controls
59 lines (59 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[user]
name = lamelizard
email = lamelizard@users.noreply.github.com
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[push]
autoSetupRemote = true
[rerere]
enabled = true
[init]
defaultBranch = main
[core]
autocrlf = input
[alias]
# short log (fits into terminal, (somewhat broken on windows))
# https://git-scm.com/docs/pretty-formats
l = log --pretty=tformat:'%C(yellow)%h%Creset -%C(red)%d%Creset %<|(-27,trunc)%s %C(green)(%<(11,trunc)%cr)%Creset %C(bold blue)<%<(10,trunc)%an>%Creset' -n 20 --topo-order
# long(er) log
ll = log --pretty=tformat:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %C(green)(%ad)%Creset %C(bold blue)<%an>%Creset' --topo-order --date=short
s = status -sb
cm = commit -m
fp = push --force-with-lease
undo = reset --soft HEAD~1
# submodules
smerge = submodule update --remote --merge
srebase = submodule update --remote --rebase
# note: most do not work with bare repos!
# branch list local (sorted by last commit)
bll = "!git for-each-ref --sort='-committerdate' --format='%(color:yellow)%(objectname:short)%(color:reset) - %(color:green)(%(committerdate:relative))%(color:reset) %(refname:short) %(color:bold blue)<%(authorname)>%(color:reset) %(color:red)[%(worktreepath)]%(color:reset)' refs/heads"
# branch list remote (sorted by last commit)
blr = "!git for-each-ref --sort='-committerdate' --count=20 --format='%(color:yellow)%(objectname:short)%(color:reset) - %(color:green)(%(authordate:relative))%(color:reset) %(refname:short) %(color:bold blue)<%(authorname)>%(color:reset)' refs/remotes"
# checkout branch using fzf
cof = "!checkout_fzf() { git branch | fzf | xargs git checkout; }; checkout_fzf"
# add (multiple) files using fzf
addf = "!add_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git add; }; add_fzf"
# add worktree in default location and checkout
wta = "!worktree_add() { local ref=$(git rev-parse --verify origin/$1 2>/dev/null || echo HEAD); git worktree add -b $1 ../$1 $ref; }; worktree_add"
wtls = worktree list
# prefetches regulary to make everything in the repo faster
make-fast = maintenance start
aliases = config --get-regexp '^alias\\.'
[includeIf "hasconfig:remote.*.url:https://git.rwth-aachen.de/**"]
path = .gitconfig-work
[includeIf "hasconfig:remote.*.url:https://github.com/MontiCore/**"]
path = .gitconfig-work
[credential "https://git.rwth-aachen.de"]
provider = generic
# WSL uses Windows credential manager,
# at least if it is in a windows folder
[includeIf "gitdir:/mnt/c/"]
path = .gitconfig-wsl
[includeIf "gitdir:/mnt/d/"]
path = .gitconfig-wsl
[safe]
directory = D:/GitHub/diss
directory = D:/GitHub/diss-refs