Skip to content

Instantly share code, notes, and snippets.

@cheecheeo
Created January 20, 2012 01:45
Show Gist options
  • Save cheecheeo/1644467 to your computer and use it in GitHub Desktop.
Save cheecheeo/1644467 to your computer and use it in GitHub Desktop.
arcanist+git pushing and cleanup
#!/bin/bash -x
# Assuming you're using the 'mutable history' workflow (rebases everywhere),
# run this script from a branch that's been accepted in Differential to
# 'arc amend' the branch, rebase the code onto master, push up the changes,
# and delete the branch.
current_branch=$(git name-rev --name-only HEAD)
git fetch && git checkout master && git pull -r &&
git checkout $current_branch &&
git rebase master && arc amend &&
# Also checks out master
git rebase $current_branch master &&
git push && git branch -d $current_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment