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

Re: backup or mirror a repository

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 28, 2007, 01:56 UTC
Message-ID
<Pine.LNX.4.64.0709280253150.28395@racer.site>
In-Reply-To
<1190940704.2263.32.camel@Tenacity>
Hi,
On Thu, 27 Sep 2007, Dan Farina wrote:
Show 9 quoted lines
> On Thu, 2007-09-27 at 22:56 +0100, Johannes Schindelin wrote:
> > I guess you're looking for "git remote add --mirror origin <url>".  
> > AFAIK this is not in any released version yet, though.
> 
> I just tried a bleeding edge git with --mirror.
> 
> It's close, except (unless there is some other provision to take care of 
> this) remote branch deletes. (Which, after more gmane trolling, seemed 
> to be "git remote rm", which doesn't seem present just yet).
git remote rm is about removing the remote nick, not a remote branch.
> Of course, it is completely possible I'm using it incorrectly. In brief, 
> I did "git init" "git remote add --mirror backup <url>" "git pull"

"git pull" without further parameters accesses the remote "origin", not "backup", and it merges _one_ branch into the current branch.

What you should have done is "git fetch backup".

Or use "origin" instead of "backup" right from the start, and then use "git fetch".

But no pull.
> (perhaps I should have used "git remote update"?) And the behavior of 
> this is more or less what I wanted, as far as sending branches. 
> Convenient removal of branches and propagating that removal still stumps 
> me. Is there a preferred way to do this yet?

You want to remove branches from the local repo which are no longer there on the remote side?

Then "git remote prune" is for you.  For details, please see the man page.

Ciao, Dscho

Previous: Dan FarinaNext: Dan Farina
Message 4 of 9 in “backup or mirror a repository”
  1. Dan FarinaSep 27, 2007
  2. Johannes SchindelinSep 27, 2007
  3. Dan FarinaSep 28, 2007
  4. Johannes SchindelinSep 28, 2007
  5. Dan FarinaSep 28, 2007
  6. Junio C HamanoSep 28, 2007
  7. Dan FarinaSep 28, 2007
  8. Dmitry PotapovOct 18, 2007
  9. Johannes SchindelinOct 30, 2007

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.