-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
110 lines (82 loc) · 3.14 KB
/
.gitconfig
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[alias]
# View abbreviated SHA, date, description, author, and history graph of the latest 20 commits
l = log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset| %s %Cgreen[%an]' -n 20 --graph --abbrev-commit --date=short
# View the current working tree status using the short format
s = status -sb
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Pull in remote changes for the current repository and update its submodules
p = !"git pull; git submodule init; git submodule update"
# Clone a repository including all submodules
c = clone --recursive
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Show verbose output about tags, branches or remotes
t = tag -l
b = branch -a
r = remote -v
# List aliases
aliases = config --get-regexp alias
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# Remove the old tag with this name and tag the latest commit with it.
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# Sign-off commits
ci = commit -s
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
# Force line endings to \n
autocrlf = input
eol = lf
# Set global `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
[color]
diff = auto
status = auto
branch = auto
ui = auto
interactive = auto
[diff]
# Detect copies as well as renames
renames = copies
# Source: http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
algorithm = patience
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
[diff "sopsdiffer"]
textconv = sops -d
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[merge]
renamelimit = 13824
# Include summaries of merged commits in newly created merge commit messages
log = true
[push]
default = simple
autoSetupRemote = true
# Make `git push` push relevant annotated tags when pushing branches out.
followTags = true
[pull]
rebase = true
[submodule]
# Source: https://github.com/blog/2188-git-2-9-has-been-released/#faster-and-more-flexible-submodules
fetchJobs = 2
[init]
defaultBranch = main
# Use separate file for username / github token / etc
[include]
path = ~/.gitconfig.local