echo -n "This will throw away all your local changes. Continue? "
read a
if [ "$a" != "y" ]
then
echo "Never mind"
exit 0
fi
git fetch origin
git reset --hard origin/master
Note: What does the -n flag to echo do, or what do you think it is trying to do? Is it the same on
your flavor of Linux? If not, read the man page for echo to figure out the proper flag to use.