Mostly git and ruby stuff
This commit is contained in:
@@ -3,12 +3,21 @@ alias b='bundle exec'
|
||||
alias please='sudo'
|
||||
alias mkbundle='bundle install --path .bundle'
|
||||
|
||||
# Git
|
||||
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
|
||||
alias gc="git commit -m"
|
||||
alias ga="git add -u && git add . && git st"
|
||||
alias gs="git st"
|
||||
|
||||
# Services start-ups and shut-downs
|
||||
|
||||
alias mysql-start="mysql.server start"
|
||||
alias mysql-stop="mysql.server stop"
|
||||
alias mysql-restart="mysql.server restart"
|
||||
|
||||
alias postgres-start="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
|
||||
alias postgres-stop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
|
||||
|
||||
alias redis-start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
|
||||
alias redis-stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
|
||||
alias redis-restart="redis-stop && redis-start"
|
||||
|
||||
+9
-10
@@ -1,18 +1,19 @@
|
||||
autoload colors && colors
|
||||
# cheers, @ehrenmurdick
|
||||
# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh
|
||||
|
||||
# Using git from Homebrew instead of default one
|
||||
git=/usr/local/bin/git
|
||||
|
||||
git_branch() {
|
||||
echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
|
||||
echo $($git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
|
||||
}
|
||||
|
||||
git_dirty() {
|
||||
st=$(/usr/bin/git status 2>/dev/null | tail -n 1)
|
||||
st=$($git status 2>/dev/null | tail -n 1)
|
||||
if [[ $st == "" ]]
|
||||
then
|
||||
echo ""
|
||||
else
|
||||
if [[ $st == "nothing to commit (working directory clean)" ]]
|
||||
if [[ "$st" =~ ^nothing ]]
|
||||
then
|
||||
echo " %F{002}($(git_prompt_info))%f"
|
||||
else
|
||||
@@ -22,14 +23,12 @@ git_dirty() {
|
||||
}
|
||||
|
||||
git_prompt_info () {
|
||||
ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return
|
||||
echo "${ref#refs/heads/}"
|
||||
ref=$($git symbolic-ref HEAD 2>/dev/null) || return
|
||||
echo "${ref#refs/heads/}"
|
||||
}
|
||||
|
||||
unpushed () {
|
||||
if [[ -a .git ]]; then
|
||||
git diff origin/master..HEAD
|
||||
fi
|
||||
$git cherry -v @{upstream} 2>/dev/null
|
||||
}
|
||||
|
||||
need_push () {
|
||||
|
||||
Reference in New Issue
Block a user