-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
71 lines (64 loc) · 2.22 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
61
62
63
64
65
66
67
68
69
70
71
[user]
useConfigOnly = true
[color]
ui = auto
[advice]
pushNonFastForward = false
statusHints = false
[core]
whitespace = fix,trailing-space,space-before-tab
autocrlf = input
filemode = false
[apply]
whitespace = nowarn
[branch]
autosetupmerge = true
[push]
default = tracking
[help]
autocorrect = 1
[rebase]
autoStash = true
[alias]
### Basic shortcuts
git = !git
st = status
br = branch
co = checkout
brn = !"git symbolic-ref --short -q HEAD"
what = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
wat = what
### Stashing
sp = stash pop
sl = stash list
### Verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
default-branch = !"git remote show origin | sed -n '/HEAD branch/s/.*: //p'"
db = default-branch
### Committing
# Amends last commit using the same commit message
amend = !"git log -n 1 --pretty=tformat:%s | git commit -F - --amend"
### Rebase
# pull complete versions of our changes or their changes
ours = "!f() { git checkout --ours "$@" && git add "$@"; }; f"
theirs = "!f() { git checkout --theirs "$@" && git add "$@"; }; f"
### Logging
# View the SHA, description, and history graph of the latest commits
l = log --pretty=oneline --graph --decorate --all
# show tree view of the git log
tree = log --graph --decorate --pretty=oneline --abbrev-commit --all
### Pushing
# Undo a `git push`
undopush = push -f origin HEAD^:master
### Syncing
# Go to master and pull in origin master
pm = !"git checkout master && git pull origin master && true"
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master && true"
# Pull in remote changes for the current repository and update all submodules
ps = !"git pull; git submodule foreach git submodule update --init --recursive && true"
# Push the current branch to origin with the same branch name
pob = !"git push "$@" origin $(git brn) && true"
fpob = pob --force-with-lease