-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
64 lines (64 loc) · 1.97 KB
/
Copy path.gitconfig
File metadata and controls
64 lines (64 loc) · 1.97 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
60
61
62
63
64
[core]
excludesfile = ~/.gitignore
autocrlf = input
[alias]
# Basic shortcuts
ci = commit
co = checkout
st = status --short --branch
sw = switch
# Log visualization
lol = log --oneline --decorate
graph = log --oneline --graph --decorate
# List commands - Git has inconsistent ways to list things,
# these aliases provide a consistent 'noun' interface:
branches = branch -a
tags = tag
stashes = stash list
remotes = remote -v
# Stacked branches utilities
# https://andrewlock.net/pushing-a-whole-stack-of-branches-with-a-single-git-command/
default-branch = "!git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'"
merge-base-origin ="!f() { git merge-base ${1-HEAD} origin/$(git default-branch); };f "
stack = "!f() { \
BRANCH=${1-HEAD}; \
MERGE_BASE=$(git merge-base-origin $BRANCH); \
git log --decorate-refs=refs/heads --simplify-by-decoration --pretty=format:\"%(decorate:prefix=,suffix=,tag=,separator=%n)\" $MERGE_BASE..$BRANCH; \
};f "
push-stack = "!f() { \
BRANCH=${1-HEAD}; \
git stack $BRANCH | xargs -I {} git push --force-with-lease origin {}; \
};f "
[push]
# Auto-create remote tracking branches
autoSetupRemote = true
[diff]
# Better diff
# https://blog.gitbutler.com/how-git-core-devs-configure-git/#better-diff
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[fetch]
# Auto-cleanup remote references
prune = true
pruneTags = true
[help]
# Suggest corrections for typos
autocorrect = prompt
[rebase]
# Automate rebase workflows:
# stash changes before rebase, update dependent branches
autostash = true
updateRefs = true
[rerere]
# Reuse Recorded Resolutions:
# Remembers how you resolved conflicts and automatically applies
# the same fix when identical conflicts occur again in future merges/rebases
enabled = true
autoupdate = true
[init]
defaultBranch = main
[include]
# Machine-specific overrides
path = ~/.gitconfig.local