Quicker clone of Magento 2 from github




Sometimes you need to quickly check something on the latest development version of Magento 2. Especially if you haven't previously pulled the repository from Github the following small change will reduce the download size by 90%:

Using
git clone --depth 1 https://github.com/magento/magento2.git
instead of
git clone https://github.com/magento/magento2.git

reduced the download size 25.72 MiB down from 307.73 MiB. In newer versions of git you can even make changes and push back your commits to the original repo.

magento2@bc49203ebbf9:/var/www$ git clone https://github.com/magento/magento2.git
Cloning into 'magento2'...
remote: Counting objects: 1260573, done.
remote: Compressing objects: 100% (3188/3188), done.
remote: Total 1260573 (delta 2251), reused 0 (delta 0), pack-reused 1256728
Receiving objects: 100% (1260573/1260573), 307.73 MiB | 1.98 MiB/s, done.
Resolving deltas: 100% (693493/693493), done.
Checking connectivity... done.
Checking out files: 100% (26074/26074), done.
magento2@bc49203ebbf9:/var/www$ git clone --depth 1 https://github.com/magento/magento2.git
Cloning into 'magento2'...
remote: Counting objects: 38566, done.
remote: Compressing objects: 100% (28117/28117), done.
remote: Total 38566 (delta 8488), reused 22761 (delta 4154), pack-reused 0
Receiving objects: 100% (38566/38566), 25.72 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (8488/8488), done.
Checking connectivity... done.
Checking out files: 100% (26074/26074), done.
Kristof Ringleff

Kristof Ringleff

Founder and Lead Developer at Fooman

Join the Fooman Community

We send our popular Fooman Developer Monthly email with Magento news, articles & developer tips, as well as occasional Fooman extension updates.