-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitconfig
More file actions
65 lines (49 loc) · 1.78 KB
/
gitconfig
File metadata and controls
65 lines (49 loc) · 1.78 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
[core]
editor = vim
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes
[user]
name = Eric Farkas
email = efarkas@adobe.com
[help]
autocorrect = 1
[color]
color = auto
branch = auto
diff = auto
status = auto
ui = true
[alias]
br = branch
st = status
co = checkout
ci = commit
# +head+ shows the latest commit for the current branch
head = log -n1
# +cbranch+ returns the current branch you are on
cbranch = !"git branch | grep '*' | cut -f2 -d' '"
cm = !"git checkout master"
undo = !"git reset --hard HEAD"
# on = !"git checkout"
# +rbranch+ returns the remote branch for the current branch you are on assuming it
# is named the same
rbranch = !"git branch -r | grep -E \"/`git cbranch`$\" | grep -v -e \"->\""
# +recent+ returns the most recent branches you've been on
recent = "for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
short-recent = "for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(refname:short)'"
squash = !"git rebase -i $(git show-ref --verify --quiet refs/heads/main && echo main || echo master)"
# +rreview+ shows changes in your local branch that its remote branch does not have
review = !"git log `git rbranch`..`git cbranch`"
# +pushr+ - pushes the current branch to the remote origin
pushr = !"git push --set-upstream origin `git cbranch`"
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[push]
default = tracking
[pull]
rebase = true
[rerere]
enabled = 1
[hub]
protocol = https
[init]
defaultBranch = main