Skip to content

Instantly share code, notes, and snippets.

@KubaJastrz
Created February 24, 2021 12:43
Show Gist options
  • Save KubaJastrz/3897425b6a573b7d0028bf3b479bc911 to your computer and use it in GitHub Desktop.
Save KubaJastrz/3897425b6a573b7d0028bf3b479bc911 to your computer and use it in GitHub Desktop.
Useful scripts
#!/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