{"thread":{"id":"5012","subject":"testing for cloned repository","startedAt":"2006-07-27T13:46:20Z","lastAt":"2006-07-27T14:10:16Z","messageCount":2,"participants":["Robert White","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24202","messageId":"0AC9E5E7-52CC-4715-BB26-622A2177308B@mac.com","threadId":"5012","inReplyTo":null,"subject":"testing for cloned repository","fromName":"Robert White","fromEmail":"kranki@mac.com","sentAt":"2006-07-27T13:46:20Z","receivedAt":"2006-07-27T13:46:20Z","isPatch":false,"sender":{"key":"kranki@mac.com","avatar":null},"body":"I am using:\nif [ -f \".git/remotes/origin\" ]; then\n\t# this repository is a clone\nfi\nin a bash script to test if a repository was cloned and then do  \nappropriate pulls and pushes which fit my situation.\nIs this the proper way to test this or should I be using something  \ndifferent?\n\nThanks in advance for your help and for providing git.  I have been  \nusing it on my Linux and MacOSX machines without any problems.\n\nBob White\n"},{"id":"24206","messageId":"Pine.LNX.4.63.0607271608260.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5012","inReplyTo":"0AC9E5E7-52CC-4715-BB26-622A2177308B@mac.com","subject":"Re: testing for cloned repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T14:10:16Z","receivedAt":"2006-07-27T14:10:16Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 27 Jul 2006, Robert White wrote:\n\n> if [ -f \".git/remotes/origin\" ]; then\n> \t# this repository is a clone\n> fi\n> in a bash script to test if a repository was cloned and then do appropriate\n> pulls and pushes which fit my situation.\n\nI think it would be better to do this:\n\n-- snip --\n. git-parse-remote\ntest \"$(get_remote_url origin)\" != origin && echo \"is cloned\"\n-- snap --\n\nThere are 3 different ways to store remote information ATM, and this \nmethod gets them all (even if, at a certain distant time in the future, \nthe default should be changed).\n\nHth,\nDscho\n"}]}