简体   繁体   中英

How to check if GIT has fully cloned a repository?

How can I check if git has successfully cloned a repository, and based on that result, execute commands inside the bash script?

I was trying some combinations of grep checking the output of git status but I've only managed to confuse myself more.

I'm ruining timeout 60s git clone ... so I must make sure the repository has cloned fully, and if it has not to skip whatever it would have done with the cloned data.

Have a look at it.

I think You are expecting this code.

https://stackoverflow.com/a/13715406/2959196

Also Have a look at the conversation. It might help you better.

How to detect if a git clone failed in a bash script

Your timeout command will return a non zero exit code if it terminates the program. Use that rather than checking the repository to see if it's cloned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM