-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
46 lines (40 loc) · 1.18 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
[alias]
alias = !git config --list | grep ^alias\\. | cut -c 7- | grep -Ei --color \"$1\" "#"
# Status and Logging
s = !echo "[$(git log -1 --format=%h)] $(git log -1 --pretty=%B)" && git status
lol = log --oneline --graph --decorate
h = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
last = log -1 HEAD
changed = diff-tree --no-commit-id --name-only -r
# Outgoing changes
o = !git cherry -v @{upstream} && git status -sb && git diff --stat @{u}..HEAD
# Staging Area (Index)
id = diff --cached
# Remove ALL files from staging area
irma = reset HEAD
irm = restore --staged
iforget = rm --cached
# Commits
back = !git reset --soft HEAD~${1:-1}
ac = !git add -A && git commit -m
# Commit Single:
ci = commit -am
cis = commit -m
ca = commit -a --amend
cas = commit --amend
# Branching
b = branch
bls = branch -a
bc = switch -c
brm = branch -d
bmv = branch -m
# Create a new branch from a specific existing branch:
#! br <new> <existing>
#! switch <new>
# Push new branch after creating it:
pn = !git push -u origin ${1:?Missing new branch name to push}
# Misc
type = cat-file -t
dump = cat-file -p
[pull]
rebase = true