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

Re: [PATCH v2] git-clone: Add option --branch to override initial branch

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Mar 3, 2009, 17:04 UTC
Message-ID
<49AD6305.8040909@gmail.com>
In-Reply-To
<7vr61eblde.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 10 quoted lines
> Tor Arne Vestbø <torarnv@gmail.com> writes:
> 
>> If you would like to contribute to the stable 1.6 branch, do:
>>   $ git clone -n git://git.foo.com/project.git
>>   $ cd project
>>   $ git checkout -t origin/1.6
>>   $ git branch -D master
>> Which is not so nice and inviting.
> 
> If you are working on 1.6 maintenance track, why discard 'master'?

One example I can think of is if master is moving a lot faster than the maintenance track, and you are not interested in master.

[box:/tmp/downstream] $ git branch
* 1.6
   master

[box:/tmp/downstream] $ git pull --rebase Current branch 1.6 is up to date.

[box:/tmp/downstream] $ git push
To file:///tmp/upstream
  ! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to 'file:///tmp/upstream'

In that case you would either have to ff master all the time (requiring a checkout or rebase magic), or do an explicit "git push origin 1.6".

Neither good options when you are trying to teach people that git push is the way you submit changes.

Tor Arne
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 19 in “git-clone: Add option --branch to override initial branch”
  1. git-clone: Add option --branch to override initial branchTor Arne Vestbø, Mar 2, 2009
  2. Johannes SchindelinMar 2, 2009
  3. Junio C HamanoMar 3, 2009
  4. Tor Arne VestbøMar 3, 2009
  5. git-clone: Add option --branch to override initial branchTor Arne Vestbø, Mar 3, 2009
  6. Johannes SchindelinMar 3, 2009
  7. Tor Arne VestbøMar 3, 2009
  8. Junio C HamanoMar 3, 2009
  9. Tor Arne VestbøMar 3, 2009
  10. Junio C HamanoMar 3, 2009
  11. Junio C HamanoMar 4, 2009
  12. Johannes SchindelinMar 4, 2009
  13. Tor Arne VestbøMar 4, 2009
  14. Paolo CiarrocchiMar 9, 2009
  15. Felipe ContrerasMar 9, 2009
  16. Paolo CiarrocchiMar 11, 2009
  17. Miles BaderMar 12, 2009
  18. Paolo CiarrocchiMar 12, 2009
  19. Felipe ContrerasMar 12, 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.