Export git subfolder to archive

Today a colleague of mine wanted to export a single folder from a git repository to a tar.gz archive. This is how to export git subfolder to archive: git archive –remote=’git@bitbucket.org:sheldon/ask-sheldon.com.git’ master path/to/file/or/folder/in/repo –format=tar.gz > archived_folder.tar.gz With this snippet the git repository folder path/to/file/or/folder/in/repo is exported to the archive file archived_folder.tar.gz. The archive will be cleared of all…

GIT – Secrets (Cheat Sheet)

Init from the scratch $> mkdir /path/to/your/project $> cd /path/to/your/project $> git init $> git remote add origin https://Bravehartk2@bitbucket.org/Bravehartk2/magento-versions.git $> git fetch First checkout $> git checkout origin/master $> git pull origin master Push to an existing repo $> cd /path/to/my/repo $> git remote add origin https://Bravehartk2@bitbucket.org/Bravehartk2/magento-versions.git $> git push -u origin –all # pushes…