{"thread":{"id":"32198","subject":"Can I zip a git repo without losing anything?","startedAt":"2012-11-26T04:55:10Z","lastAt":"2012-11-26T13:04:41Z","messageCount":3,"participants":["Carl Smith","Andrew Ardill","Konstantin Khomoutov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203852","messageId":"CAP-uhDcQg0BuEdHDTa6qVqLCeB-LE1GZtEqHgY_j1--XodsDKw@mail.gmail.com","threadId":"32198","inReplyTo":null,"subject":"Can I zip a git repo without losing anything?","fromName":"Carl Smith","fromEmail":"carl.input@gmail.com","sentAt":"2012-11-26T04:55:10Z","receivedAt":"2012-11-26T04:55:10Z","isPatch":false,"sender":{"key":"carl.input@gmail.com","avatar":null},"body":"Hi all\n\nThis is my first post to this list, so thank you for all your work.\n\nAfter suggesting using zip files to move our projects around, I was\ntold that you can not zip a git repo without loosing all the history.\nThis didn't make sense to me, but two people told me the same thing,\nso I wasn't sure. I think they may have been confusing the zipped file\nyou can download from GitHub with a zipped git repo.\n\nIf someone could put me straight on this, I'd really appreciate it.\n\nThanks\n\nCarl\n"},{"id":"203853","messageId":"CAH5451n4EQ16-bpKGiDZMu42ewSX_Jeg3Z9mcCHvvBv-xzoTfw@mail.gmail.com","threadId":"32198","inReplyTo":"CAP-uhDcQg0BuEdHDTa6qVqLCeB-LE1GZtEqHgY_j1--XodsDKw@mail.gmail.com","subject":"Re: Can I zip a git repo without losing anything?","fromName":"Andrew Ardill","fromEmail":"andrew.ardill@gmail.com","sentAt":"2012-11-26T05:06:25Z","receivedAt":"2012-11-26T05:06:25Z","isPatch":false,"sender":{"key":"andrew.ardill@gmail.com","avatar":"https://gravatar.com/avatar/da14cb7c091dd44dc6c63a4d3361b149acaf25226dc78eb4131a17b93d9b0993?d=mp&s=160"},"body":"On 26 November 2012 15:55, Carl Smith <carl.input@gmail.com> wrote:\n> Hi all\n>\n> This is my first post to this list, so thank you for all your work.\n>\n> After suggesting using zip files to move our projects around, I was\n> told that you can not zip a git repo without loosing all the history.\n> This didn't make sense to me, but two people told me the same thing,\n> so I wasn't sure. I think they may have been confusing the zipped file\n> you can download from GitHub with a zipped git repo.\n\nHi Carl,\n\nThe basics of it are as follows, a little simplified to hopefully make it clear\n\nGit uses a working directory that contains the files which you are\nworking on. These get converted into a snapshot when you commit, and\nthese commits form the history of your project. These snapshots along\nwith everything else that git needs to work are stored in the git\ndirectory, often called \".git\".\n\nWhen you zip the files you are working on you are creating a manual\nsnapshot of your project. If you zip the git directory you are\ncompressing the entire git repository and this has enough information\nto recreate your entire history. If you zip both of them you get your\nhistory as well as any changes that have not been committed yet. When\na server holds a copy of your repository it will not include a working\ndirectory at all, but instead just the git directory. In this\nsituation the git directory will often be called the same name as the\nproject.\n\nThe zip from GitHub does indeed only contain the working directory,\nand so doesn't include the history.\n\nHope that helps!\n\nRegards,\n\nAndrew Ardill\nRegards,\n\nAndrew Ardill\n"},{"id":"203873","messageId":"20121126170441.a6c94f108bc57cca8bcfe679@domain007.com","threadId":"32198","inReplyTo":"CAP-uhDcQg0BuEdHDTa6qVqLCeB-LE1GZtEqHgY_j1--XodsDKw@mail.gmail.com","subject":"Re: Can I zip a git repo without losing anything?","fromName":"Konstantin Khomoutov","fromEmail":"kostix+git@007spb.ru","sentAt":"2012-11-26T13:04:41Z","receivedAt":"2012-11-26T13:04:41Z","isPatch":false,"sender":{"key":"kostix+git@007spb.ru","avatar":null},"body":"On Mon, 26 Nov 2012 04:55:10 +0000\nCarl Smith <carl.input@gmail.com> wrote:\n\n> After suggesting using zip files to move our projects around, I was\n> told that you can not zip a git repo without loosing all the history.\n> This didn't make sense to me, but two people told me the same thing,\n> so I wasn't sure. I think they may have been confusing the zipped file\n> you can download from GitHub with a zipped git repo.\n> \n> If someone could put me straight on this, I'd really appreciate it.\n\nTo amend the already provided answer -- if you need to move repos\naround using the sneakernet, the tool you should probably use is\n`git bundle`.\n"}]}