-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
36 lines (30 loc) · 1.25 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
# This file should contain the [user] section
# with name and email set, for example:
# [user]
# name = Username
# email = [email protected]
#
# It can also contain additional per-directory configs,
# for example:
# [includeIf "gitdir:~/Projects/Work/"]
# path = ~/Projects/Work/.gitconfig
# [includeIf "gitdir:~/Projects/School/"]
# path = ~/Projects/School/.gitconfig
[include]
path = ~/.user.gitconfig
[core]
excludeFiles = ~/.gitignore_global
[init]
defaultBranch = main
[pull]
ff = only
[push]
autoSetupRemote = true
[alias]
lg = log --graph --abbrev-commit --decorate --format="format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"
unpushed = log --branches --not --remotes --no-walk --decorate --oneline
# FIXME: Diff against the nearest parent, not `dev`
branch-summary = "!f() { git diff --compact-summary $(git merge-base ${1:-dev} @) @; }; f"
branch-diff = "!f() { git diff $(git merge-base ${1:-dev} @) @; }; f"
# branch-summary, but grepped for `migrations` - useful for Django
branch-migrations = "!f() { git diff --name-only $(git merge-base ${1:-dev} @) @ | grep migrations; }; f"