Skip to content

Instantly share code, notes, and snippets.

@noherczeg
Created February 6, 2017 08:49
Show Gist options
  • Select an option

  • Save noherczeg/e9921072e370b3a8060417f6c85eb274 to your computer and use it in GitHub Desktop.

Select an option

Save noherczeg/e9921072e370b3a8060417f6c85eb274 to your computer and use it in GitHub Desktop.
#!/bin/bash
branch=$1
echo "--------------------------------"
echo "Moving to branch: ${branch}"
echo "--------------------------------"
git fetch
git checkout $branch
git reset --hard origin/$branch
git clean -d -f
git pull
echo "--------------------------------"
echo "Status:"
echo "--------------------------------"
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment