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

Re: Clone a repo and checkout a specifc remote branch

From
PCPaolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Date
Mar 7, 2009, 23:25 UTC
Message-ID
<4d8e3fd30903071525g27960764rbc1cee77e4334a6e@mail.gmail.com>
In-Reply-To
<1cd1989b0903071053l3f7aa35bu8e8e6b7e56cfc34f@mail.gmail.com>
On 3/7/09, Patrick Notz <patnotz@gmail.com> wrote:
Show 22 quoted lines
>> Something like:
>> $ git clone git://uri_of_the_repo:coolbranch localdir
>> to get a clone of the whole repository and to check out the
>> origin/coolbranch remote branch?
>>
>
> Here's a link to a recent thread on this topic (that started with a
> proposed patch)
>
> http://thread.gmane.org/gmane.comp.version-control.git/111967
>
> You can read the arguments there.  Johannes Schindelin noted that the
> normal way to do this is like this:
>
> <quote>
> Besides, the common way to check out something different than the remote's
> HEAD is like this:
>
> $ git clone -n $URL
> $ cd $DIR
> $ git checkout -t origin/$BRANCH
> </quote>
Thank you, very appreciated, I missed that discussion.
I'll add my comments to that thread.
Regards,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/
http://mypage.vodafone.it/
Previous: Patrick Notz
Message 3 of 3 in “Clone a repo and checkout a specifc remote branch”
  1. Paolo CiarrocchiMar 7, 2009
  2. Patrick NotzMar 7, 2009
  3. Paolo CiarrocchiMar 7, 2009

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.