-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
48 lines (39 loc) · 1 KB
/
aliases
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
# Unix
alias ll="ls -al"
alias ln="ln -v"
alias mkdir="mkdir -p"
alias e="$EDITOR"
alias v="$VISUAL"
# Bundler
alias b="bundle"
alias be="bundle exec"
# Rails
alias migrate="bin/rails db:migrate db:rollback && bin/rails db:migrate db:test:prepare"
alias s="rspec"
# Lint
alias lint="be standardrb --fix"
# Pretty print the path
alias path='echo $PATH | tr -s ":" "\n"'
# Include custom aliases
if [[ -f ~/.aliases.local ]]; then
source ~/.aliases.local
fi
git-co-upstream-pr() {
pull_request_number=$1
local_branch_name=$2
if [ -z "$pull_request_number" -o -z "$local_branch_name" ]; then
echo "usage: git-co-upstream-pr <pull_request_number> <local_branch_name>"
return 1
fi
if git remote -v | grep -q upstream; then
git fetch upstream "pull/$pull_request_number/head:$local_branch_name"
git checkout "$local_branch_name"
else
cat <<HELP
You don't have an upstream remote set.
Use:
git remote add upstream {upstream_remote_url}
to set the reference and then try again.
HELP
fi
}