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

Difference between git-clone --bare and git-push --all to empty repo

From
Pedro Melo <melo@simplicidade.org>
Date
Jun 13, 2008, 11:23 UTC
Message-ID
<7D042A31-9CC8-4740-8185-7165AEF6E0DF@simplicidade.org>
Hi,

I have a private repository on my laptop and for backup purposes only, I created a remote repository to push to.

I created the remote repo in two ways:
1. git-clone --bare

I used git-clone --bare to create a bare repository with a copy of my work and rsync'ed that to the remote server

2. git init a bare repo and git push --all
I created a empty bare repository with
    mkdir project_backup
    GIT_DIR=project_backup git init
and then pushed my work to it:
   cd project
   git push --all ../project_backup
and rsync'ed the project_backup directory.

I see the same number of objects and the same branches on both bare repositories, but the first one created with git-clone uses a lot more space, even after git-repack -d -a on both.

I'm still learning the internals of git, but I could not find any explanation for this. Care to enlighten me?

Thanks in advance,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo@simplicidade.org
Use XMPP!
Message 1 of 1 in “Difference between git-clone --bare and git-push --all to empty repo”
  1. Pedro MeloJun 13, 2008

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.