-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
60 lines (59 loc) · 2.19 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[alias]
ci = commit -v
co = checkout
lg = log --graph --abbrev-commit --date=short --pretty=tformat:'%C(yellow)%h %C(cyan)%ai%C(red)%d%Creset %s %C(green)<%an>%Creset' # add --all to show all branches
st = status -sb
branches = branch -av
remotes = remote -v
prune-all = !git remote | xargs -n 1 git remote prune
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
unstage = reset HEAD
undo-commit = reset --soft HEAD^
poh = push origin HEAD -u --tags
pohf = push origin HEAD -u --tags --force-with-lease
roh = !git reset --hard origin/`git symbolic-ref --short HEAD`
ignore = git update-index --assume-unchanged
unignore = git update-index --no-assume-unchanged
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
delete-merged = !git branch --merged | grep -v '^\\*' | xargs -n 1 git branch -d
delete-all = !git branch | grep -v '^\\*' | xargs git branch -D
whats-changed = !git log --no-merges origin/`git symbolic-ref --short HEAD`.. # what's changed on remote version of current branch
files-changed = "!git diff --name-status $(git merge-base $1 $2) $1 #" # probably want $1 to be a feature branch, $2 to be main or master
add-without-whitespace = !sh -c 'git diff -w --no-color "$@" | git apply --cached --ignore-whitespace' - # give it a file and it will add all changes except whitespace changes
rebase-since-master = !git rebase -i `git merge-base HEAD master`
[checkout]
defaultRemote = origin
[color]
diff = auto
status = auto
branch = auto
[commit]
verbose = true
[core]
editor = code --wait
excludesfile = ~/.gitignore_global
autocrlf = input
[diff]
algorithm = histogram
submodule = log
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[init]
defaultBranch = main
[pull]
ff = only
[push]
default = current
[rebase]
autosquash = true
[rerere]
enabled = true
[status]
relativePaths = false
[submodule]
recurse = true
[include]
path = ~/.gitconfig_secret
submoduleSummary = true