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

Re: [PATCH] Added a few examples to git-pull man page.

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Nov 5, 2005, 19:37 UTC
Message-ID
<200511052037.12410.Josef.Weidendorfer@gmx.de>
In-Reply-To
<7vk6fno36c.fsf@assigned-by-dhcp.cox.net>
On Saturday 05 November 2005 10:27, Junio C Hamano wrote:
Show 18 quoted lines
> Maybe something like this (I know my wording is quite bad and I
> would appreciate rephrasing it better very much) would be more
> explicit and appropriate?
> 
>     If you intend to do development derived from a remote
>     branch B, have a `Pull:` line to track it, like this:
> 
>         Pull: B:remote-B
> 
>     and have a separate branch my-B to do your development
>     on top of it.  The latter is created by 'git branch my-B
>     remote-B' (or its equivalent, 'git checkout -b my-B
>     remote-B'), and that is the branch you make your own
>     commits.  Run 'git fetch' to keep track of the progress
>     of the remote side, and when you see the tracked remote
>     branch has something new, merge it into your development
>     branch with 'git pull . remote-B', while you are on my-B
>     branch.
It would be good to explicitly mention that exactly this is
already setup for you after cloning: you are prepared to do
local development based on the remote "master", with
	- remote head "B" = remote head "master"
	- local head "remote-B" = local head "origin"
	- local head "my-B" = local head "master"

Hmm. I just looked up the manual page of "git-clone", but it does not mention this. It also should say that all remote heads are cloned to local heads with the same name, with one exception: remote "master" matches local "origin".

This feels really inconsistent. Junio, I think your proposal of tracking remote "B" with local "origin/B" is a lot better. It allows to name a local development branch for any remote "B" by the same local name "B".

We could make heads starting with "origin/" special: Never let "git commit" update such a head, but give out a warning instead, that this head should not be changed locally, as it is used for tracking a remote head. This warning could suggest to do "git branch" before committing. This special handling (of "origin/") should not be hardcoded, but configurable, perhaps in .git/remotes:

	URL: remote-URL
	Prefix: origin/
Josef
Previous: Junio C Hamano
Message 3 of 3 in “Added a few examples to git-pull man page.”
  1. Added a few examples to git-pull man page.Jon Loeliger, Nov 5, 2005
  2. Junio C HamanoNov 5, 2005
  3. Josef WeidendorferNov 5, 2005

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.