Skip to content

Instantly share code, notes, and snippets.

@brianc
Created March 27, 2015 13:50
Show Gist options
  • Save brianc/32d2835d6f752a65b1b8 to your computer and use it in GitHub Desktop.
Save brianc/32d2835d6f752a65b1b8 to your computer and use it in GitHub Desktop.

Revisions

  1. brianc created this gist Mar 27, 2015.
    13 changes: 13 additions & 0 deletions git-mainline
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/bash


    branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')

    git fetch
    git rebase origin/master
    git rebase -i HEAD~`git log origin/master.. --pretty=oneline | wc -l | sed -e 's/^[ \t]*//'`
    git push origin $branch --force
    git checkout master
    git pull
    git merge $branch
    git log master ^origin/master