You can use the following where:
- $ {Organization} as a user or GitHub organization
- $ {Repository} is the name of the repository
curl -L https://api.github.com/repos/${Organization}/${Repository}/tarball > ${Repository}.tar.gz
The top level directory in the .tar.gz file has a hash of the commit in the directory name, which can be a problem if you need an automatic way to change the resulting directory and do something.
In the method below, this will be excluded and leave the files in a folder with a predictable name.
mkdir ${Repository} curl -L https://api.github.com/repos/${Organization}/${Repository}/tarball | tar -zxv -C ${Repository} --strip-components=1
Casey Apr 29 '17 at 16:21 2017-04-29 16:21
source share