-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitconfig
More file actions
107 lines (84 loc) · 3.17 KB
/
gitconfig
File metadata and controls
107 lines (84 loc) · 3.17 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
# include in .gitconfig
# [include]
# path = scripts/gitconfig
#
[diff]
#external = diff_git_meld.py
#external = git-diff-cmd.sh
[color]
ui = auto
[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
[alias]
# WORKTREES
wl = worktree list
wa = "!f() { git worktree add -b "$1" ../working_"$1" origin/"$1"; }; f"
waf = "!f() { git worktree add -b "juan/$1" "../working_$1" origin/"$2"; }; f"
wp = worktree prune
# COMMONS
alias = !git config --list | grep alias
st = status -sb
ci = commit
br = branch
co = checkout
df = diff
dfn = diff --stat=160,120
dc = diff --cached
dlc = diff --cached HEAD^
ds = diff --staged
cp = cherry-pick
# pull branch
pullr = "!f() { git fetch --prune; git rebase --autostash; }; f"
# did you forget to include a file with your last commit, or maybe you had
# one tweak you needed to make? Amend the staged changes to your last commit.
amend = commit --amend -C HEAD
# undo: sometimes, amending your last commit isn't enough and you'll need to undo it instead.
# This alias will step back one commit and leave the changes from that commit staged.
# Now you can make additional changes, or recommit with a new message
undo = reset --soft HEAD^
# LOGS
lg = log -p
lol = log -lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short -graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
head = !git ld -1
b = "!. ~/scripts/.githelpers && pretty_git_branch"
# Remove submodule git rms path/to/submodule
rms = "!f(){ git rm --cached \"$1\";rm -r \"$1\";git config -f .gitmodules --remove-section \"submodule.$1\";git config -f .git/config --remove-section \"submodule.$1\";git add .gitmodules; }; f"
# Files updates in the last commit
dl = "!git ll -1"
# Find file. Ej: git f filename
f = "!git ls-files | grep -i"
# Find string . Ej. git grep FOO
grep = grep -Ii
# Rename branch XXXX to done-XXXX. Ej, git done branchname
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
standup = log --since '1 day ago' --oneline --author jlopezcarreno
# Show files ignored by git:
ign = ls-files -o -i --exclude-standard
# reset commands
# r = reset
# r1 = reset HEAD^
# r2 = reset HEAD^^
# rh = reset --hard
# rh1 = reset HEAD^ --hard
# rh2 = reset HEAD^^ --hard
# git subversion
# svnr = svn rebase
# svnd = svn dcommit
# svnl = svn log --oneline --show-commit