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

Re: [PATCH v2] Add --track option to git clone

From
David Soria Parra <sn_@gmx.net>
Date
Dec 2, 2009, 07:20 UTC
Message-ID
<slrnhhc58g.cpv.sn_@experimentalworks.net>
In-Reply-To
<BLU0-SMTP487572F057CC9D30C837D7AE950@phx.gbl>
On 2009-12-02, Sean Estabrooks <seanlkml@sympatico.ca> wrote:
Show 15 quoted lines
>> It tries to make the following usecase possible:
>> Imagine you are working on a project that has 1.x and a 2.x branch. The project
>> itself requires a complex setup (webserver, configuration files, etc). Setting up
>> 1.x and 2.x branch requires a lot of work, but a developer needs to maintain both.
>> He'll use the --track option to clone the 2.x branch into a directory and does the same
>> with the 1.x branch, where he setup the project. He can use locally separate repositories
>> while still being able to push to just one remote repository.
>
> This is already straightforward in Git without the limitation of tracking only
> a single remote branch.   What is the necessity of doing this via the clone command?
>
>   $ git init myrepo
>   $ cd myrepo
>   $ git remote add -t branch1.x -f origin <URL>
>   $ git checkout -t origin/branch1.x

I'm aware that this is possible, but I want to have a shortcut for this as the users that I helped with getting into git usually where confused about the point that you have to do it manually via git init, so take the patch as a proposal to get more consistent interface for git clone.

david
Previous: Sean EstabrooksNext: Nanako Shiraishi
Message 5 of 13 in “Add --track option to git clone”
  1. Add --track option to git cloneDavid Soria Parra, Dec 1, 2009
  2. 1/2 Teach clone to clone just one remote branch using --trackDavid Soria Parra, Dec 1, 2009
  3. 2/2 Documentation: Add --track option to the git clone manpageDavid Soria Parra, Dec 1, 2009
  4. Sean EstabrooksDec 2, 2009
  5. David Soria ParraDec 2, 2009
  6. Nanako ShiraishiDec 2, 2009
  7. David Soria ParraDec 2, 2009
  8. Jeff KingDec 2, 2009
  9. David Soria ParraDec 2, 2009
  10. Nanako ShiraishiDec 2, 2009
  11. Jeff KingDec 2, 2009
  12. Junio C HamanoDec 2, 2009
  13. Björn SteinbrinkDec 3, 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.