Skip to content

Instantly share code, notes, and snippets.

@cwsaylor
Created September 3, 2008 00:53
Show Gist options
  • Select an option

  • Save cwsaylor/8511 to your computer and use it in GitHub Desktop.

Select an option

Save cwsaylor/8511 to your computer and use it in GitHub Desktop.
hack sink ship
# 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
#
# An editor will be displayed with all of the commit messages allowing you to make one giant
# combined commit (merge --squash). Add the story (from xp) to the top and save.
#
# 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
# CHANGELOG
# Implementing squash in ship
# Making changes so that the commands are more error proof
# hack
#!/bin/sh -x
git checkout master
git pull origin master
git checkout -b $1 master
# sink
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master ${CURRENT}
# ship
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git merge --squash ${CURRENT} && git commit -a -v && git push origin master
@rickmzp
Copy link
Copy Markdown

rickmzp commented Dec 23, 2011

this is still the gist I use the most

@cwsaylor
Copy link
Copy Markdown
Author

cwsaylor commented Dec 23, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment