top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Strange effect with tar file of a cloned repository in GIT

+1 vote
376 views

I've been trying to put my filesystem for a very small busybox-based distro into a git-repository. And with success. The only strange thing I can not get my head around is the following :

When making a compressed tarball from the files from the repository (after clone/checkout) I get a very much larger tar.gz-file. Size goes up from 16M to 21M (!?)

posted Aug 19, 2013 by Sonu Jindal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

My guess is that the cloned repository isn't compressed in exactly the same way as the original repository.

The first step would be to find out the amount of disk space occupied by the original and the cloned repositories (using "du -s") rather than depending on the size of the .tar files.

If you want the repository to be small, look into "git gc --aggressive".

answer Aug 19, 2013 by Majula Joshi
+1 vote

Here some things to check:
Produce tar files rather than tar.gz files and see if the size difference is still present. The ordering of files in a tar file might affect how efficient the compression is.

Get a directory listing of both tar files (-tv) and see if they contain exactly the same files, and with exactly the same lengths. Do a tree file comparison between the files that go into the original tar and the ones that go into the new tar.

answer Aug 21, 2013 by Sheetal Chauhan
Similar Questions
+1 vote

At some point I added a large file into a git repository. It now exists on multiple branches, possibly with some changes to it. I'd like to remove it from git, but leave its current form (say the one on the master branch) on the file system.

I tried (on a dummy git archive)

git filter-branch --index-filter 'git rm --cached --ignore-unmatch bigfile' master branch1 branch2

That, however, does not leave a copy of bigfile on the file system.It isn't clear to me why not, though the description of the --tree-filteroption to filter-branch (I'm using the --index-filter option, but is is "similar") states:" (new files are auto-added, disappeared files are auto-removed ... )".
Is there a direct way to do what I want, with git? I've found similar requests;none of the responses point out that the above command actually deletes the file from the file system.

0 votes

with git I noticed when I removed a remote branch with git push origin --delete in my clone when I used git branch -a I don't the deleted branch but my colleagues still see it.

I tried with two clones in my PC, with the first one delete branch and the other still sees it despite git pull .

I use git version 2.9.4

+1 vote

I would like to use Git with a SVN, so I try to clone the SVN repo with "git svn clone svn://myserver", it is a repo without trunk etc. Git reports the error "Couldn't find a repository". The SVN repo uses an authentification (username & password) and a normalsvn checkout works well.
How can I use the SVN repo with Git?

+1 vote

When cloning a large repo stalls, hitting Ctrl+c cleans what been downloaded, and process needs re-start.

Is there a way to recover or continue from already downloaded files during cloning? Please point me to an archive url if solution exists. (though I continue to search through them as I email this)

Can there be something like: git clone --use-method=rsync

+1 vote

How to configure a read-only copy of a remote Git repository on a local server in bare mode and automatically synchronize its contents.

I need to configure a mirror of the repository hosted at another location and the mirrored repository should automatically perform syncing of code at regular intervals.

...