-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
39 lines (38 loc) · 2.1 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
[user]
email = [email protected]
name = Michael Leung
[alias]
co = checkout
cm = commit
rb = rebase
br = branch
df = diff --color
fd = diff --name-only
st = status
cp = cherry-pick
hist = log --all --graph --pretty='[%C(cyan)%h%Creset]%C(bold cyan)%d%Creset %s'
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lgtime = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=iso
lgme = !git lg --author='Michael Leung' # Log only my commits
cob = checkout -b # Create and switch branch
up = !git fetch origin master:master && git rebase master # Update master, rebase onto it
pom = !git fetch origin master:master --update-head-ok # Do a fetch and update master
save = !git add -A && git commit -m 'SAVEPOINT' # Create a quick and dirty commit for easy branch switching
saveout = !git save && git co # Save and swap branch
undo = reset HEAD~1 --mixed # Uncommit most recent, the opposite of 'git save'
amend = commit -a --amend --no-edit
unstage = reset HEAD
pop = stash pop
brs = log --branches --graph --pretty='[%C(cyan)%h%Creset]%C(bold cyan)%d%Creset %s'
changed = !git diff $(git merge-base $(git rev-parse --abbrev-ref HEAD) $(git rev-parse --abbrev-ref --symbolic-full-name @{u}))
pushme = !git push origin $(git rev-parse --abbrev-ref HEAD)
pullme = !git pull origin $(git rev-parse --abbrev-ref HEAD)
signrebase = !git rebase --exec 'git commit --amend --no-edit -n -S' -i # Rebase and sign each commit. Takes a branch name on the end.
rebasesign = !git signrebase
recents = for-each-ref --sort=-committerdate --count=10 refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
new = !git pom && git co master && git cob
continue = "-c core.editor=true rebase --continue"
[commit]
verbose = true
[pull]
rebase = false