Created
June 22, 2017 10:21
-
-
Save DBarthe/8f52f14e6abd4d5935f915778f6b58d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
remote=${1:-origin} | |
branch=${2:-master} | |
commit=$(git log -1 | head -n 1 | cut -d' ' -f 2) | |
git push ${remote} +${commit}^:${branch} | |
git reset HEAD^ --hard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment