1. 30

  2. 11

    I find git bundle useful for a lot more than emailing an entire repository. Also useful for tons of other situations in which you can’t access an online repository. You can put any individual commits into a bundle and treat it as a remote. I used git-bundle to update code on airgapped machines with repository of dozens of GB.

    1. 9

      How the hell is that a headache to zip a git checkout? Also what does the entry level blurb have to do with git bundle? If you can’t get it to work it’s probably the code’s fault and not that it wasn’t properly zipped? I don’t understand any of the premise or the problem. Thanks for the hint to git bundle though.

      1. 2

        Note that a simple archive of the entire repository will include site-local data (perhaps even sensitive data like access credentials for databases or API endpoints) that is otherwise excluded from the repository by gitignore rules. If I frequently had to create repository archives, I would probably grow annoyed with cleaning up those files before archiving, or I might forget to do so on occasion. git bundle exists for this exact use case, which is distinct from simply archiving your work tree that happens to have a git repository in it.

        1. 1

          Not to mention that the zip file could include hook scripts, which might be a security risk.

          1. 1

            I have nothing against the use of git bundle and I’m happy I now know it exists, my criticism was mostly aimed at the perceived motivation of the blog post :)

          2. 0

            Also, bundle gives you smaller files than simply creating a zip file or a tarball, without the need for an additional tool for extraction, and it’s very easy to screw up the creation/extraction of archives such that you end up with a whole bunch of crap in your current working directory rather than the subdirectory that you expect it to be extracted to.

            The scenario is a bit contrived, but the problems it solves are not.

            1. 1

              I’m not disagreeing here, theres a reason I inspect every zip file AND always make a new dir and unzip it in there, on principle.

              But I’m not really sure if the overlap of “people who create a mess with zip files” and “people who would know about git bundle” is meaninful.

              1. -1

                I would imagine that the set of people who realise git bundle exists in the first place is very small, but has now grown a bit. git bundle is a superior solution to using archives for this kind of thing, in spite of its command line interface being leaky.

                Also, when a tool makes it really easy to shoot yourself in the foot, I blame the tool, not the user. It’s far too easy to accidentally create a zip file that will bite the person extracting it, and similarly easy to forget to check on the receiving side.

          3. 3

            At my company, people just send in a link to their project repo that is hosted somewhere like GitHub or Gitlab.

            Is it common to ask for a zip of a project?

            1. 2

              Of course, there are many more use cases for this feature than simple code interview submissions, and additional features I haven’t described.

              Don’t want something on a public repo, don’t want to deal with adding a token/key to a private repo for a third party, email.

              1. 1

                Is it common to ask for a zip of a project?

                Today at work I got several zips of a project.

                Git bundle will be useful if I still don’t have everything I need tomorrow.

              2. 1

                I this very different from compressing the entire project folder including the .git directory?