Skip to content

Instantly share code, notes, and snippets.

@rickmzp
Forked from cwsaylor/gist:8511
Last active December 18, 2015 19:38
Show Gist options
  • Save rickmzp/5834111 to your computer and use it in GitHub Desktop.
Save rickmzp/5834111 to your computer and use it in GitHub Desktop.
Variation on Hashrocket's script for managing the git process
as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
Create shell scripts out of each of these, put them in your path (~/bin for example)
chmod 755 them and use like this:
This version of hack is totally different than Hackrockets. I feel that hack implies
that you are getting started, not finishing up. sink is Hashrockets hack.
$ hack branch_name
Test and Implement until done
$ sink && rake
$ ship
If any step fails, the && will prevent the next step from moving executing
btw, sink == sync, sync is taken and I like the double entendre anyway
#!/bin/sh -x
git checkout master
git pull origin master
git checkout -b $1 master
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git merge --no-ff ${CURRENT} && git commit -a -v && git push origin master
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master ${CURRENT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment