Check if the PAT has a repo permission and show an error message if it does not have that permission and do not allow saving of the settings until a correct token with proper permission is provided.
Also check the permission when doing the actual push and show an appropriate UI error message.
Show an appropriate UI error message for any exception/errors.