threads / discuss / 13929

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

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

## tl;dr

One message between Jun 13, 2008 and Jun 13, 2008.

replies: 0people: 1as markdown or json

Pedro Melo· Jun 13, 2008, 11:23 UTC · lore
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!

← back to recent threads