-
Notifications
You must be signed in to change notification settings - Fork 2
/
aliases.ini
67 lines (67 loc) · 3.57 KB
/
aliases.ini
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
[alias]
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
be = branch --edit-description
br = branch
# Delete all local branches but master and the current one.
br-delete-useless-force = "!f(){ git branch | grep -v "master" | grep -v "development" |grep -v ^* | xargs git branch -D; }; f"
branches = "!git branch -vv"
changes = diff --name-status -r
cm = commit
cma = commit -a -m
cmau = commit -a -m "update"
cmap = "!f() { git commit -a -m \"$@\" && git push; }; f"
cmapu = "!f() { git commit -a -m \"update\" && git push; }; f"
co = checkout
conflicts = diff --name-only --diff-filter=U
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
delete-remote = "push origin --delete"
development = checkout development
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
dt = difftool
# update development, go back to current branch and merge development
du = "! git checkout development; git pull; git checkout @{-1}; git merge development;"
email = config user.email
empty = commit --allow-empty
# https://blog.filippo.io/git-fixup-amending-an-older-commit/
fixup = "!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ${@:2} && EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"
flp = log --follow -p
github = !git config user.name "JBlond" && git config user.email "[email protected]"
identity = "! git config user.name \"$(git config user.$1.name)\"; git config user.email \"$(git config user.$1.email)\"; :"
in = !git remote update -p; git log ..@{u}
incoming = !git remote update -p; git log ..@{u}
last = log -1 --stat
lc = diff @~..@
last-commit = "!git lc"
last-tag = describe --tags --abbrev=0
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %C(bold blue)<%an>%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold yellow)%d ⟹ %C(white)%s %C(bold blue)%an%C(reset) %C(bold green)%cD%C(reset)'
lgm = log --oneline --abbrev-commit --format=format:'| %as | %s | %h |' --all
lgn = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %C(bold blue)<%an>%C(reset)%C(bold yellow)%d%C(reset)' --all --name-status
lgp = "!git lg -p"
list-branches = branch -vv
ls = ls-files
master = checkout master
main = checkout main
merged = branch -a --merged
name = config user.name
new-branch = checkout -b
open = "!f() { REPO_URL=$(git config remote.origin.url); explorer ${REPO_URL%%.git}; }; f"
out = "!f() { C_BRANCH=$(git branch --show-current); git log --graph --abbrev-commit --date=relative origin/${C_BRANCH%%}..${C_BRANCH%%}; }; f"
patch = !git --no-pager diff --no-color
remotes = remote -v
remove-ignored = clean -fX
rename = mv
rollback = checkout @~1
search = "!git rev-list --all | xargs git grep -F"
shallow = clone --depth 1
shallow-branch = clone --depth 1 -b
st = status -sb
su = submodule update --recursive --remote
undo = reset --hard
unpublish = !"git push origin :$(git branch-name)"
untracked = ls-files --others --exclude-standard
week = log --stat --since='1 Week Ago' --graph --pretty=oneline --abbrev-commit --date=relative
who = shortlog -s --
yesterday = log --after="yesterday"