Skip to content

Instantly share code, notes, and snippets.

@joslynesser
Created November 1, 2010 02:17

Revisions

  1. joslynesser revised this gist Nov 1, 2010. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions git-repull-ship.bash
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,4 @@ function ship {
    git merge ${CURRENT}
    git push origin master
    git branch -d ${CURRENT}
    }

    # squash: Squash all of your commits into a single commit
    alias squash='git rebase -i master'
    }
  2. joslynesser created this gist Nov 1, 2010.
    23 changes: 23 additions & 0 deletions git-repull-ship.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/sh -x
    # repull: Merge the latest changes from the master branch into your current branch
    function repull {
    ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0
    CURRENT="${ref#refs/heads/}"
    git checkout master
    git pull origin master
    git checkout ${CURRENT}
    git rebase master
    }

    # ship: Ship out current branch to master and delete local branch
    function ship {
    ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0
    CURRENT="${ref#refs/heads/}"
    git checkout master
    git merge ${CURRENT}
    git push origin master
    git branch -d ${CURRENT}
    }

    # squash: Squash all of your commits into a single commit
    alias squash='git rebase -i master'