-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
119 lines (105 loc) · 3.52 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
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
118
119
### Coreutils Aliases
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # And for good measure
alias l='ls -lah' # Long view, show hidden
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -lFh' # Long view, no hidden
alias lS='ls -lhS' # Sort files by size in a directory
alias dots='ls -ld .?*' # Show ONLY dot files
alias cp="cp -R"
alias mkdir="mkdir -p"
alias grep="grep --color"
alias yy="rsync -azv --progress" # --archive (copy perms, etc.) --zip --verbose
# rsync <source> <destination>
### Git Aliases
alias gst='git status -sb'
alias glr='git pull --rebase'
alias gsp='git stash pop'
alias gitl='git log --pretty=format:"%h - %an, %ar : %s"'
alias git-undo='git reset --soft HEAD~1'
alias git-lines="git ls-files | xargs wc -l"
alias git-count='git shortlog -sn'
alias glogd='git log --graph --decorate'
alias sl='git log --oneline --decorate -20'
alias sla='git log --oneline --decorate --graph --all -20'
alias slap='git log --oneline --decorate --graph --all'
alias check-prs="zsh ~/code/check-prs.zsh"
### Aliases & Functions
alias a='atom'
alias be='bundle exec'
alias rake="noglob rake"
alias art='php artisan'
alias bower='noglob bower'
alias sha256='shasum -a 256'
alias desk='cd ~/Desktop'
alias code='cd ~/Dropbox/code'
alias vhosts='st /etc/hosts'
alias chrome='open -a "Google Chrome"'
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
alias showlibrary='chflags nohidden ~/Library/'
alias hidelibrary='chflags hidden ~/Library'
# copy/paste this function into wherever you keep your terminal scripts
# e.g. `.bashrc`, or `.bash_profile`, or `.zshrc`
tw () {
# Branch names must begin with a Teamwork ticket number followed by a dash.
# for example: 12345678-branch-name-here
if [[ ! $@ =~ ^[0-9]{8}- ]]; then
echo "Branch name needs to start with a Teamwork ticket number"
return
fi
# Get the first 8 characters from the branch name (Teamwork ticket number)
# so we can build the Teamwork task's URL.
taskNumber=$(echo $@ | cut -c1-8)
taskUrl="https://esports.eu.teamwork.com/#/tasks/$taskNumber"
# $@ is the argument passed to this function.
# In this case, it's the branch name.
git checkout dev &&
git pull origin dev &&
git checkout -b $@ &&
git commit -m "#$taskNumber Starting work on $taskUrl" --allow-empty -n &&
git push -u origin $@ &&
gh pr create --title $@ --body $taskUrl
}
# Github Issue
gissue () {
git checkout staging &&
git pull origin staging &&
git checkout -b "issues/$@" &&
git commit -m "Fixes #$@" --allow-empty &&
git push -u origin "issues/$@" &&
hub pull-request -i "$@"
}
# Github Issue on master branch
gissuem () {
git checkout master &&
git pull origin master &&
git checkout -b "issues/$@" &&
git commit -m "Fixes #$@" --allow-empty &&
git push -u origin "issues/$@" &&
hub pull-request -i "$@"
}
gtrack() {
if [[ $# -eq 0 ]]; then
echo "Needs a PR number"
return
fi
hub pull-request -i "$@" -b 7Geese:staging
}
gpush() {
if [[ $# -eq 0 ]]; then
echo "Needs a PR number"
return
fi
git push -u origin "issues/$@"
gtrack "$@"
}
gopen() {
if [[ $# -eq 0 ]]; then
echo "Needs a PR number"
return
fi
git checkout staging
git checkout -b issues/"$@"
}