git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: testing for cloned repository

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 27, 2006, 14:10 UTC
Message-ID
<Pine.LNX.4.63.0607271608260.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<0AC9E5E7-52CC-4715-BB26-622A2177308B@mac.com>
Hi,
On Thu, 27 Jul 2006, Robert White wrote:
Show 5 quoted lines
> if [ -f ".git/remotes/origin" ]; then
> 	# this repository is a clone
> fi
> in a bash script to test if a repository was cloned and then do appropriate
> pulls and pushes which fit my situation.
I think it would be better to do this:

-- snip -- . git-parse-remote test "$(get_remote_url origin)" != origin && echo "is cloned" -- snap --

There are 3 different ways to store remote information ATM, and this method gets them all (even if, at a certain distant time in the future, the default should be changed).

Hth, Dscho

Previous: Robert White
Message 2 of 2 in “testing for cloned repository”
  1. Robert WhiteJul 27, 2006
  2. Johannes SchindelinJul 27, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.