-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitconfig
More file actions
115 lines (115 loc) · 3.25 KB
/
.gitconfig
File metadata and controls
115 lines (115 loc) · 3.25 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
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
110
111
112
113
114
115
[user]
name = Giovane Boaviagem Ribeiro
email = giovanebribeiro@gmail.com
[init]
defaultBranch = master
templateDir = /home/gbr/.git-template
[color]
diff = auto
grep = auto
interactive = auto
status = auto
branch = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = white
[pretty]
changelog = format:* %h %s
history = format:'%Cred%h %C(magenta)(%an)%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr, %ci) %C(bold blue)%Creset'
[alias]
##
# DIFF
##
di=diff
# shows only the diff from the files in the staging area
staged=diff --cached
# shows the diff between the staging area and your modified files.
di-staged = !git diff-index --cached --name-only --diff-filter=ACMR HEAD | xargs git di
# Show the list of modified files for a given commit
di-commit = diff-tree --no-commit-id --name-status -r
# gives you the diff between your working tree and the last commit
dilc = diff --cached HEAD^
##
# LOGS
##
# logs in a must beautiful form
ll = log --color --graph --pretty=history --abbrev-commit
# log for a single file
lf = log -u
# more detailed logs
ls = log --oneline --no-merges --stat
# more detailed logs (reverse)
la = log --oneline --reverse --no-merges --stat
##
# TAGS
##
tt = for-each-ref --sort=-creatordate --count=3 --format '%(refname) (%(creatordate))\n===\n%(subject)\n\n' refs/tags
##
# PUSH/PULL/FETCH
##
f = fetch --all -v --prune
pu = push --follow-tags
puf = push --follow-tags --force
psuo = push --follow-tags --set-upstream origin
# fetch and push all locally-tracked remote branches
up = pull
# applies the changes from remote only when it would be possible via fast forward
ff = pull --ff-only
##
# COMMIT
##
cam = commit -am
cm = commit -m
ca = commit -a
canvm = commit --no-verify -am
##
# CHECKOUT
##
co = checkout
cob = checkout -b
# Reverts changes for files in 'staged' area
co-staged=!git diff-index --cached --name-only --diff-filter=ACMR HEAD | xargs git di
##
# OTHERS
##
# prune already merged branches
rip = ! bash $HOME/.local/bin/clean_pruned_branches.sh
st = status -sb
# Show active users on repo in last 6 months
active = shortlog --numbered --email --summary --no-merges --since='6 months'
a = add
aa = add --all
# collect the commits since the last tag
changelog = "!git log $(git describe --tags --abbrev=0)..HEAD --pretty=changelog"
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
# allows re-write the entire feature commits. Useful to cleanup local branch history before a pull
# request
faxina = "! git merge-base $(git rev-parse --abbrev-ref HEAD) $1 | git rebase -i"
rename = branch -m
unstash = stash pop
[core]
editor = /usr/bin/vim
excludesfile = ~/.gitignore_global
[push]
default = matching
[pull]
rebase = false
[status]
submoduleSummary = true
[merge]
tool = vimdiff
conflictstyle = diff3
[mergetool]
prompt = false
[github]
user = giovanebribeiro
# Specific configurations for my work. Include a second gitconfig if repo inside ~/workspace
[includeIf "gitdir:~/workspace/"]
path = ~/workspace/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/