Is there a way to download the contents of a git repo from the Unix command line that doesn't pull down everything in the .git directory? I just want the latest version of the repo directories and files, not all the diffs.
Also, is it possible to accomplish this without using a git command (perhaps with wget or curl, for example)?
Thanks.
GitHub User InterfaceThere's a download button on the repository's homepage. Of course, this downloads the entire repo, after which you would need to unzip the download and then manually drag out the specific folder you need.
Thanks. Yes you can, but there's no need to copy the full working tree. You can copy just the . git folder without the working tree (i.e. as a "bare" repo) and then checkout the latest working tree on the other machine.
When downloading materials to your laptop, it is easiest to download the entire repository. To do this, go to the GitHub page for the workshop, click on the green Code button, then download the repository as a ZIP file. The filename may be different than what's in the picture. Find the downloaded .
github has a link to download a .zip archive of the repo, so try using
wget https://github.com/[user]/[repo]/archive/[branch].zip
with [user]
, [repo]
, and [branch]
replaced with the appropriate fields.
As far as I know, the closest thing you can do is to do a git clone --depth=1
(to avoid retrieving more information from the server than you need for the latest version) and then delete the .git
directory afterwards. As far as git is concerned, the .git
directory is the repo; the checked-out files are just there for your convenience. :)
2nd part : You can try the username and repo name substituted correctly
wget http://github.com/[username]/[repo]/archive/master.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With