-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig.erb
47 lines (47 loc) · 2.76 KB
/
gitconfig.erb
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
[user]
name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %>
email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %>
[fetch]
prune = true
[alias]
co = checkout
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lg1 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg3 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg2"
lag = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%= '<%' %>an<%= '>' %>%Creset' --abbrev-commit --
# see all of your local branches with their last updated dates
branchdate = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads
recentbranches = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads | grep --invert-match 'months' | grep --invert-match 'year' | grep --invert-match '[56789] weeks ago'
branchname = !git rev-parse --abbrev-ref HEAD
# deletes local branches that have been merged to master
cleanupmaster = !git branch --merged master | egrep -v '\\s+master$' | xargs git branch -d
# deletes local branches that have been merged to main
cleanup = !git branch --merged main | egrep -v '\\s+main$' | xargs git branch -d
updatefrommaster = !if [[ $(git rev-parse --abbrev-ref HEAD) = "master" ]]; then echo "you're already on master"; else git pull && git checkout master && git pull && git checkout - && git merge master; fi
updatefrommain = !if [[ $(git rev-parse --abbrev-ref HEAD) = "main" ]]; then echo "you're already on main"; else git pull && git checkout main && git pull && git checkout - && git merge main; fi
switchto = !sh -c 'git checkout $1 && git pull' -
coi = !git branch $@ | cut -c 3- | fzf --reverse --preview 'git log --patch --color {}...{}~5' | xargs git checkout
cp = cherry-pick
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[core]
excludesfile = ~/.gitignore
editor = vim
autocrlf = input
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr)%Creset
[github]
user = <%= print("GitHub Username: "); STDOUT.flush; STDIN.gets.chomp %>
[credential]
helper = osxkeychain
[push]
default = current