S
S
Serufim2019-10-18 11:29:58
git
Serufim, 2019-10-18 11:29:58

How to clone a private repository via bash and ask for them again if the username and password are entered incorrectly?

Hello everyone, there is such a problem, from a private repository in gittea via vpn you need to clone it via bash.
I write something like this At startup, git asks for a username and password, and if the input fails, the script moves on. Is it possible to somehow ask to enter them again if the data is entered incorrectly until they enter it correctly. And another question, how to stop the script execution if the login and password for git are entered incorrectly
git clone http://10.8.0.4:3050/my-user/my_repo.git

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
paran0id, 2019-10-18
@Serufim

Catch the git clone exit code, see what value it takes depending on the situation (bad password, server unavailable, etc.).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question