-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
78 lines (70 loc) · 2.62 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
[alias]
# View the SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph
ll = log --oneline --decorate --graph --all #-n 20
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit the current state
d = !"git diff-index --quite HEAD -- || clear; git diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number`revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD-$!; }; git diff-index --quiet HEAD -- || clear; d"
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# Clone a repository including all submodlues
c = clone --recursive
# commint all changes
ca = !git add -A && git commit -aV
# Switch to a branch, creating it if necessary
go = checkout -B
# show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# Credit an author on the latest commit
credit = "!f() {git commit --amend --author \"$1 <$2>\" - C HEAD; }; f"
# Interactive rebase with the given number of latest commmits
reb = "!r() { git rebase -i HEAD-$1; }; r"
# Create a snapshot of your working directory
snapshot = "!snapshot(){ COMMENT=wip; if [ \"$*\" ]; then COMMENT=\"$*\"; fi; git add -A; git commit -m \"$COMMENT\"; };snapshot"
# List remote branches
list-remote-branches= "!listRemoteBranches(){ git branch -r | sed \"/->/d; s/ origin\\///g\"; }; listRemoteBranches"
# Checkout remote branches
checkout-remote-branches = "!checkoutRemoteBranches() { for name in `git list-remote-branches`; do git checkout $name; done; }; checkoutRemoteBranches"
# Clone with branches
clone-with-branches = "!cloneWithBranches() { git clone $1 $2; cd $2; git checkout-remote-branches; git remote rm origin; }; cloneWithBranches"
# Unstage file
unstage = reset HEAD --
last = log -1 HEAD
[apply]
# Detect whitespaces errors when applying a patch
whitespace = fix
[core]
whitespace = space-before-tab,indent-with-non-tab,trailing-space
[user]
name = Marcus Almeida
#email = [email protected]
#email = [email protected]
email = [email protected]
[color]
diff = auto
status = auto
branch = auto
[push]
default = matching
[core]
editor = vim
mergetool = meld
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = white bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = red bold
untracked = yellow bold
[merge]
tool = meld