-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
82 lines (59 loc) · 2.2 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
[user]
name = Gaetan
username = astsu777
email = gaetan@ictpourtous.com
[core]
editor = vim
pager = cat
# Configure Git to ensure line endings in files you checkout are correct for macOS and Linux
autocrlf = input
# Global ignore file (not shared)
excludesfile = ~/.gitignore_global
# Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# Display configured aliases
la = "!git config -l | grep alias | cut -c 7-"
# Display log in a prettier format
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
# Display log with changed files
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
# Display log and show dates
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# Display log and show relative date
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
# Display log with no colors for piping
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
# Display log for a specific file
fl = log -u
# Display changed files in last commit
dl = "!git ll -1"
# Display full changes in last commit
dlc = diff --cached HEAD^
# Show full diff on a given commit
dr = "!f() { git diff "$1"^.."$1"; }; f"
lc = "!f() { git ll "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
# Ensure that force-pushing won't lose someone else's work (only mine).
push-with-lease = push --force-with-lease
# List local commits that were not pushed to remote repository
review-local = "!git lg @{push}.."
# Edit last commit message
reword = commit --amend
# Undo last commit but keep changed files in stage
uncommit = reset --soft HEAD~1
# Remove file(s) from Git but not from disk
untrack = rm --cache --
# Perform operation on all git subfolders
all = "!f() { ls -R -d */.git | xargs -I{} bash -c \"echo {} && git -C {}/../ $1\"; }; f"
[pull]
# Automatically rebase when pulling
rebase = true
[rebase]
# Automatically stash local modifications when rebase
autostash = true
[init]
defaultBranch = master