Answer by Gabriel Staples for git "ping": check if remote repository exists
The fastest and most-reliable way I've found in bash is this:if timeout 30s git ls-remote --tags > /dev/null 2>&1; then # Note: it takes 2~4 sec to get to here. echo "git server IS...
View ArticleAnswer by Alberto Salvia Novella for git "ping": check if remote repository...
By disabling asking for credentials, then listing the remote head only:export GIT_TERMINAL_PROMPT=0git ls-remote "${repo}" HEAD &> /dev/null
View ArticleAnswer by vaab for git "ping": check if remote repository exists
TL;DR:git ls-remote is the way, here is a shell-ready function for quick access: ## Returns errlvl 0 if $1 is a reachable git remote url git-remote-url-reachable() { git ls-remote "$1"...
View ArticleAnswer by Oleksiy Chystoprudov for git "ping": check if remote repository exists
If you use --exit-code argument you can skip sending output to null. It will return something only in case of error.Also, you can use -h argument to show only heads references.git ls-remote --exit-code...
View ArticleAnswer by ony for git "ping": check if remote repository exists
You can narrow output by using something like git ls-remote "$REPO_URL" HEAD
View ArticleAnswer by Peter Eisentraut for git "ping": check if remote repository exists
I think the git ls-remote command is pretty much made for that purpose.
View Articlegit "ping": check if remote repository exists
I'd like to know whether a remote repository exists. Here's what I came up with:git ls-remote -h "$REPO_URL"&> /dev/nullIs there any better way?
View Article
More Pages to Explore .....