-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaliases.sh
More file actions
46 lines (31 loc) · 1.24 KB
/
aliases.sh
File metadata and controls
46 lines (31 loc) · 1.24 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
## Useful git aliases we use at FormaServe
## one line git status
git config --global alias.st 'status -sb'
## one liner git log
git config --global alias.ll 'log --oneline'
## last commit
git config --global alias.last 'log -1 HEAD --stat'
## git commit with message flag
git config --global alias.cm 'commit -m'
## shorten git remote
git config --global alias.rv 'remote -v'
## git diff shortener
git config --global alias.d 'diff'
## search a commit
git config --global alias.se '!git rev-list --all | xargs git grep -F'
## shorten status
git config --global alias.s 'status'
## shorten checkout
git config --global alias.co 'checkout'
## create branch & move into it
git config --global alias.cob 'checkout -b'
## Delete a branch
git config --global alias.del 'branch -D'
## list all branches by commit date
## git config --global alias.br 'branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate'
## Rollback changes
git config --global alias.undo 'reset HEAD~1 --mixed'
## git log
git config --global alias.undo 'reset HEAD~1 --mixed'
## list all git aliases
git config --global --list