In my bash script ,a private repo is being cloned which prompts for username and password. The issue is even if incorrect username or password is entered and the git authentication fails - remote: Invalid username or password
and the script proceeds further ignoring it .i want the git username and password read prompts to run in loop until git authentication succeeds . In other words , if incorrect username or password is entered it should be detected by bash and the read prompts should rerun in loop until git authentication is successful
#!/usr/bin/env bash
# something ....
read -e -p "Input your github username : " username
read -e -p "Input your github password : " password
git clone https://"$username":"$password"@github.com/"$username"/repo
# something ...
How do i solve this problem ?