I need to download zip/tar Git repositories from Github and get not just the source but also the .git directory.

I'm aware I could use git clone, but this is for an tool that runs on systems that may not necessarily have git installed. Zipped repos are downloaded (doesn't require git) and after that I would like the .git directory there so users who do have git have a fully working git repo and can start branching, etc.

Anybody know of a Github endpoint or flag that includes the .git dir in zips?

  • relevant? – Raystafarian Feb 8 '14 at 12:01
  • Interesting that svn can be used here, though users without Git installed are unlikely to have SVN either. Perhaps I'll just make Git a requirement. – dgh Feb 11 '14 at 10:31
  • while there is probably not a git endpoint, it wouldn't be difficult to model. git clone {repo} && zip {reponame}. I'm pretty sure the reason the folder is omitted is that it is intended as a release artifact, even if it's not common to include baked-in dependencies (which as long as you're using a dependency manager and build-system that supports clearing baked-in-deps is not a problem either) – MrMesees May 20 '18 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.