-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_aliases
More file actions
117 lines (105 loc) · 3.09 KB
/
.bash_aliases
File metadata and controls
117 lines (105 loc) · 3.09 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# commands and functions for personal optimal productivty
# alias flutter="fvm flutter"
# alias dart="fvm dart"
alias vpn='~/vpn/vpn.sh'
alias v='nvim'
alias vi='nvim'
alias gw='git worktree '
alias gwa='git worktree add'
alias gwr='git worktree remove'
alias gb='git branch'
alias gc='git clone'
alias gco='git checkout'
alias gcm='git commit -m'
alias ga='git add'
alias gaA='git add -A'
alias gp='git push'
alias qc='cd ~/konohagakure/qccore/'
alias gpl='git pull --depth 1'
alias gst='git status'
alias g='git'
alias d='docker'
alias dc='docker compose'
alias j='java'
alias gcca='gcloud config configurations activate'
alias gpr='git pull --rebase'
alias runserver='python manage.py runserver'
alias rplus='python manage.py runserver_plus'
alias migrate='python manage.py migrate'
alias makemigrations='python manage.py makemigrations'
alias validateqc='DJANGO_SETTINGS_MODULE=quickcheckbackend.settings.dev ./scripts/static_validate_backend.sh
'
alias sortqc='isort --atomic --profile black src/ tests/'
alias runblack='black --line-length 120 --skip-string-normalization src/ tests/'
alias runprospector='cd src && prospector --profile=../.prospector.yml --path=.'
alias testbiling='pytest --reuse-db --no-migrations --disable-warnings --cov=src --cov-config=.coveragerc --cov-report=html tests/v3/python/billing -v'
# change directory into my dotfiles directory at the speed of light
alias dots='cd ~/.dotfiles'
# make new directory for me
# doesn't matter if the subdirectory exists or not
mdm() {
if [[ ! -z $1 ]]; then
mkdir -p $1 && cd $1
fi
}
log() {
case "$1" in
"")
# If no argument is passed, then show the log between the current branch and the remote branch
git log $(git rev-parse --abbrev-ref @{upstream})\..HEAD --oneline --graph --decorate --color=always
;;
"count")
# If passed argument is count, then show the number of commits since the last pull
# ref: https://stackoverflow.com/questions/3258243/git-how-to-find-out-if-there-have-been-any-changes-since-my-last-pull
git log $(git rev-parse --abbrev-ref @{upstream})\..HEAD --oneline --graph --count
;;
"file")
shift
git log -1 --oneline --name-status --follow -- "$@"
;;
"tags")
shift
git log "$1".."$2" # show me the log between two release tags
;;
*)
# write me a short documentation
echo "Usage: log [count|file|tags]"
echo """
count: show the number of commits since the last pull
file: show the log of a file
tags: show the log between two release tags
"""
;;
esac
}
# Realias GitLab to reduce the long command output
gl() {
glab $@ | head -n 35
}
# Git bisect alias
# ref: https://stackoverflow.com/questions/4713010/how-to-use-git-bisect
gbisect() {
case "$1" in
"start")
git bisect start
;;
"bad")
git bisect bad
;;
"good")
git bisect good
;;
"reset")
git bisect reset
;;
"auto")
git bisect start
git bisect bad
git bisect good $(git describe --tags --abbrev=0)
;;
*)
echo "Usage: gbisect [start|bad|good|reset|auto]"
;;
esac
}
alias git_prune="git fetch --prune && git branch -vv | grep 'origin/.*: gone]' | awk '{print \$1}' | xargs git branch -d"