Skip to content

Instantly share code, notes, and snippets.

@neckro
Created January 1, 2014 01:51
Show Gist options
  • Save neckro/8204161 to your computer and use it in GitHub Desktop.
Save neckro/8204161 to your computer and use it in GitHub Desktop.
only way to be sure.
#!/bin/bash
default_branch="master"
repo_dir="$HOME/www"
branch=$1
[ -z "$branch" ] && branch="$default_branch"
cd $repo_dir
git fetch
git clean -fd
git checkout --force $branch
git reset --hard origin/$branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment