- Improved error handling to ensure the script exits on failure. - Added a check for the current branch to ensure it is 'main' before proceeding. - Updated git commands for better state management and clarity in user feedback messages.