git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can I zip a git repo without losing anything?
@ 2012-11-26  4:55 Carl Smith
  2012-11-26  5:06 ` Andrew Ardill
  2012-11-26 13:04 ` Konstantin Khomoutov
  0 siblings, 2 replies; 3+ messages in thread
From: Carl Smith @ 2012-11-26  4:55 UTC (permalink / raw)
  To: git

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.

If someone could put me straight on this, I'd really appreciate it.

Thanks

Carl

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can I zip a git repo without losing anything?
  2012-11-26  4:55 Can I zip a git repo without losing anything? Carl Smith
@ 2012-11-26  5:06 ` Andrew Ardill
  2012-11-26 13:04 ` Konstantin Khomoutov
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Ardill @ 2012-11-26  5:06 UTC (permalink / raw)
  To: Carl Smith; +Cc: git@vger.kernel.org

On 26 November 2012 15:55, Carl Smith <carl.input@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Can I zip a git repo without losing anything?
  2012-11-26  4:55 Can I zip a git repo without losing anything? Carl Smith
  2012-11-26  5:06 ` Andrew Ardill
@ 2012-11-26 13:04 ` Konstantin Khomoutov
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khomoutov @ 2012-11-26 13:04 UTC (permalink / raw)
  To: Carl Smith; +Cc: git

On Mon, 26 Nov 2012 04:55:10 +0000
Carl Smith <carl.input@gmail.com> wrote:

> 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.
> 
> If someone could put me straight on this, I'd really appreciate it.

To amend the already provided answer -- if you need to move repos
around using the sneakernet, the tool you should probably use is
`git bundle`.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-26 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26  4:55 Can I zip a git repo without losing anything? Carl Smith
2012-11-26  5:06 ` Andrew Ardill
2012-11-26 13:04 ` Konstantin Khomoutov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).