Last active
December 26, 2021 08:38
-
-
Save CervEdin/2e72388c3f7d9b30d961ec3b64d08761 to your computer and use it in GitHub Desktop.
Interactive force push
This file contains 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/bash | |
git log --oneline --graph @{upstream}...HEAD | |
git diff @{upstream} HEAD | |
read -p "Push (with force)?" -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
git push --force-with-lease | |
exit $? | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment