Created
February 24, 2021 12:43
-
-
Save KubaJastrz/3897425b6a573b7d0028bf3b479bc911 to your computer and use it in GitHub Desktop.
Useful scripts
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
#!/bin/sh | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
remote="${1:-origin}" | |
# Wait for confirmation with Enter key | |
read -p "git reset --hard $remote/$branch " y | |
git fetch "$remote" "$branch" | |
git reset --hard "$remote"/"$branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment