-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig-complete
62 lines (62 loc) · 1.46 KB
/
gitconfig-complete
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
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home folder, e.g. C:\Users\<YourName>
#
# BASIC SETTINGS
#
[user]
name = <Firstname> <Lastname>
email = <firstname>.<lastname>@<domain>.<tld>
[commit]
template = ~/.gitmessage
[core]
excludesfile = ~/.gitignore
[init]
defaultBranch = main
[push]
default = simple
[submodule]
recurse = true
#
# CUSTOM SETTINGS
#
# Alias definition
[alias]
# show branches
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
# commit staged files
c = commit
# stage modified files and commit
ca = commit -a
# commit with following message
cm = commit -m
# stage modified files and commit with following message
cam = commit -am
# diff unstaged changes
d = diff
# diff staged changes
dc = diff --cached
# show last commit
last = log -1 HEAD --stat
# compact log output
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# simple git status
s = status -sb
# undo last commit
undo = reset --soft HEAD~1
#
# Color settings
[color]
ui = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan