summaryrefslogtreecommitdiff
path: root/dot_gitconfig.tmpl
blob: 0abe1e49a65a3559260f1c57b8b6f064f3d11341 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
# vim:ft=gitconfig

# ~/.gitconfig
# ============================================================================
# This Git configuration contains sane defaults for my workflow.
# I work with Git on Windows and Linux, and some configuations might
# use different locations. This mainly contains the aliases I want
# to keep consistent between machines.

{{/* This file supports Go's text/template language. */ -}}

[core]
    {{ if .work -}}
    excludesfile = !/home/u_muftei/.gitignore
    {{ else -}}
    excludesfile = !/home/ibrahim/.gitignore
    {{ end -}}
[init]
    defaultBranch = main
[push]
	autoSetupRemote = true
	default = current
[user]
	name = {{ .git_name }}
	email = {{ .git_email }}
[alias]
	staash = stash --all
	trueblame = blame -w -C -C -C
	wdiff = diff --word-diff
	fpush = push --force-with-lease
	sdiff = diff --staged
    nadd = add -N .
    padd = add -p .
    undostage = restore --staged .
	# Just for the memes
	fixed = commit --amend --no-edit
	gud = push --force-with-lease
	rekt = !git reset --hard && git clean -df
[rerere]
	enabled = true
	autoUpdate = true
[branch]
	sort = committerdate
{{ if eq .chezmoi.os "windows" -}}
[credential "https://github.com"]
	helper = 
	helper = !'C:\\Program Files\\GitHub CLI\\gh.exe' auth git-credential
[credential "https://gist.github.com"]
	helper = 
	helper = !'C:\\Program Files\\GitHub CLI\\gh.exe' auth git-credential
{{ else if eq .chezmoi.os "darwin" -}}
[credential "https://github.com"]
    helper =
    helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://gist.github.com"]
    helper =
    helper = !/opt/homebrew/bin/gh auth git-credential
{{ else -}}
[credential "https://github.com"]
    helper =
    helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
    helper =
    helper = !/usr/bin/gh auth git-credential
{{ end -}}
[pull]
	rebase = true
[filter "lfs"]
	process = git-lfs filter-process
	required = true
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f