Skip to content

Instantly share code, notes, and snippets.

@noherczeg
Created June 13, 2017 14:55
Show Gist options
  • Save noherczeg/e3ce173adf111bdc8e27b80141d3c45d to your computer and use it in GitHub Desktop.
Save noherczeg/e3ce173adf111bdc8e27b80141d3c45d to your computer and use it in GitHub Desktop.
git reset to param branch
#!/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