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

Re: fetch for bare repository

From
Carlos Martín Nieto <cmn@elego.de>
Date
Jan 13, 2012, 13:40 UTC
Message-ID
<20120113134058.GB2850@centaur.lab.cmartin.tk>
In-Reply-To
<4F100A7B.3030001@gmail.com>
On Fri, Jan 13, 2012 at 02:42:03PM +0400, Dmitry A. Ashkadov wrote:
> Hello!
> 
> I can't understand how to fetch branches from external repository
> for bare repository.

What you probably want is a mirror (git clone --mirror). Unless you tell git that you want a mirror, it's going to assume that you want a bare repo to push your own changes up to it. Such a repo has no need to be kept up to date, so clone doesn't set up any fetch refspecs.

Stepping back, do you need to fetch those branches into the private repo? If you still have access to the main repo and that's where the main project development is happening, why not use upstream's repo to get those changes to your local repo (as in the one you use to work)? It sounds like you're trying to replicate a centralised VCS' workflow. Git works like a network and you can merge a branch from upstream if you need to and then push to the private repo.

   cmn
Previous: Dmitry A. AshkadovNext: Dmitry A. Ashkadov
Message 2 of 4 in “fetch for bare repository”
  1. Dmitry A. AshkadovJan 13, 2012
  2. Carlos Martín NietoJan 13, 2012
  3. Dmitry A. AshkadovJan 13, 2012
  4. Carlos Martín NietoJan 13, 2012

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.