Re: Can I zip a git repo without losing anything?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26 November 2012 15:55, Carl Smith <carl.input@xxxxxxxxx> wrote:
> Hi all
>
> This is my first post to this list, so thank you for all your work.
>
> After suggesting using zip files to move our projects around, I was
> told that you can not zip a git repo without loosing all the history.
> This didn't make sense to me, but two people told me the same thing,
> so I wasn't sure. I think they may have been confusing the zipped file
> you can download from GitHub with a zipped git repo.

Hi Carl,

The basics of it are as follows, a little simplified to hopefully make it clear

Git uses a working directory that contains the files which you are
working on. These get converted into a snapshot when you commit, and
these commits form the history of your project. These snapshots along
with everything else that git needs to work are stored in the git
directory, often called ".git".

When you zip the files you are working on you are creating a manual
snapshot of your project. If you zip the git directory you are
compressing the entire git repository and this has enough information
to recreate your entire history. If you zip both of them you get your
history as well as any changes that have not been committed yet. When
a server holds a copy of your repository it will not include a working
directory at all, but instead just the git directory. In this
situation the git directory will often be called the same name as the
project.

The zip from GitHub does indeed only contain the working directory,
and so doesn't include the history.

Hope that helps!

Regards,

Andrew Ardill
Regards,

Andrew Ardill
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]