Bunch of changes inspired by r00k
This commit is contained in:
47
zsh/functions
Normal file
47
zsh/functions
Normal file
@@ -0,0 +1,47 @@
|
||||
function git-new-remote-tracking {
|
||||
git checkout -b $1 && git push -u origin $1
|
||||
}
|
||||
|
||||
function git_branch_name {
|
||||
val=`git branch 2>/dev/null | grep '^*' | colrm 1 2`
|
||||
echo "$val"
|
||||
}
|
||||
|
||||
function git-done {
|
||||
branch=`git_branch_name`
|
||||
git checkout master && git merge $branch --ff-only && bundle install && rake db:migrate db:test:prepare && rake && git push && git branch -D $branch && git push origin :$branch
|
||||
}
|
||||
|
||||
function git-nuke {
|
||||
git branch -D $1 && git push origin :$1
|
||||
}
|
||||
|
||||
function git-on-master {
|
||||
branch=`git_branch_name`
|
||||
git checkout master && git pull --rebase
|
||||
git checkout $branch
|
||||
git rebase master
|
||||
}
|
||||
|
||||
function g {
|
||||
if [[ $# > 0 ]]; then
|
||||
git $@
|
||||
else
|
||||
git status
|
||||
fi
|
||||
}
|
||||
compdef g=git
|
||||
|
||||
function rrg {
|
||||
rake routes | grep $1
|
||||
}
|
||||
|
||||
function take {
|
||||
mkdir $1
|
||||
cd $1
|
||||
}
|
||||
|
||||
# Allows commit message without typing quotes (can't have quotes in the commit msg though).
|
||||
function gc {
|
||||
git commit -m "$*"
|
||||
}
|
||||
Reference in New Issue
Block a user