Skip to content

Instantly share code, notes, and snippets.

@RichardBray
Created May 20, 2024 08:47
Show Gist options
  • Save RichardBray/f4d4e3c82784f14dc68da19400ecd5ad to your computer and use it in GitHub Desktop.
Save RichardBray/f4d4e3c82784f14dc68da19400ecd5ad to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script is a W.I.P
# To use it, just save the file and run sh git-pull.sh
git fetch
git diff HEAD..FETCH_HEAD
read -p "Do you want to merge? (Y/n) " answer
if [[ -z "$answer" ]]; then
answer="y"
fi
case ${answer:0:1} in
y|Y )
git merge FETCH_HEAD
echo "Thank you for merging."
;;
* )
echo "Exiting without merging."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment