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

Re: newbie: should git bare repositories (forked ones) have an origin defined?

From
Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com>
Date
May 6, 2010, 00:49 UTC
Message-ID
<u2n86ecb3c71005051749m95977244oa5c5ee809599dc4c@mail.gmail.com>
In-Reply-To
<q2r408104421005050940k2d054b20zad05552623ba2338@mail.gmail.com>
On 5 May 2010 17:40, Robert Buck <buck.robert.j@gmail.com> wrote:
Show 11 quoted lines
>
> Question:
>
> Is what I am inquiring about reasonable, or is there a good reason to
> not have remote refs embedded into the public forked repository?
> How should public forked repositories ("next" in the use case above)
> be initially created on its host?
>
> Thank you,
>
> Bob

"origin" & "master" are just the default names for a remote & where HEAD points to on remote repository.

A bare repository usually doesn't have any refs/remotes/* instead it just has refs/heads/*

When you clone a bare repository refs/heads/* from bare repository are pulled into refs/remotes/<remotename>/*

look at your .git/config to see how flexible this is.
you can do
[remote "qa-branches"]
      url = ../qa
      fetch = +refs/heads/qa-stable:refs/heads/stable
      fetch = +refs/heads/qa-appprove:refs/heads/next
      fetch = +refs/heads/qa-pending:refs/heads/dev
[remote "bob"]
      url = ../bob
      fetch = +refs/heads/qa-rejected:refs/heads/experimental

This repository can be public and you can have many remotes defined all fetching into refs/heads.

Now set-up bare repositories that you like and set-up as many remotes as locations you need to fetch from, figure out which heads to you need to fetch & how you want to call them and you are done =)

Previous: Robert Buck
Message 2 of 2 in “newbie: should git bare repositories (forked ones) have an origin defined?”
  1. Robert BuckMay 5, 2010
  2. Dmitrijs LedkovsMay 6, 2010

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.