How to archive all Magento 2 files excluding not important for development ones?

tar \
	--exclude='*.gz' \
	--exclude='*.mov' \
	--exclude='*.mp4' \
	--exclude='*.ogv' \
	--exclude='*.pdf' \
	--exclude='*.tgz' \
	--exclude='*.webm' \
	--exclude='*.zip' \
	--exclude='./.easyssl_backup' \
	--exclude='./.git' \
	--exclude='./.github' \
	--exclude='./.sucuriquarantine' \
	--exclude='./.well-known' \
	--exclude='./__MACOSX' \
	--exclude='./adminer.php' \
	--exclude='./blog' \
	--exclude='./catalog/product/cache' \
	--exclude='./cgi-bin' \
	--exclude='./dev' \
	--exclude='./dist' \
	--exclude='./generated' \
	--exclude='./magmi' \
	--exclude='./node_modules' \
	--exclude='./ow_scripts' \
	--exclude='./pub/*import*' \
	--exclude='./pub/images' \
	--exclude='./pub/media/amasty/amoptimizer_dump' \
	--exclude='./pub/media/amasty/amoptmobile' \
	--exclude='./pub/media/amasty/amopttablet' \
	--exclude='./pub/media/amasty/webp' \
	--exclude='./pub/media/cache' \
	--exclude='./pub/media/captcha' \
	--exclude='./pub/media/catalog/product/cache' \
	--exclude='./pub/media/descriptions' \
	--exclude='./pub/media/helpdesk/attachments' \
	--exclude='./pub/media/import' \
	--exclude='./pub/media/importexport' \
	--exclude='./pub/media/ipattachments' \
	--exclude='./pub/media/magefan_blog' \
	--exclude='./pub/media/megnor_blog' \
	--exclude='./pub/media/product/cache' \
	--exclude='./pub/media/shipment*.png' \
	--exclude='./pub/media/tmp/catalog/product' \
	--exclude='./pub/static/*' \
	--exclude='./pub/ub-tool' \
	--exclude='./pub/wp' \
	--exclude='./sucuri-backups' \
	--exclude='./test' \
	--exclude='./tmp' \
	--exclude='./var' \
	--exclude='./vendor/magento/magento2-base' \
	--exclude='./vendor/magento/sample-data-media/catalog/product' \
	--exclude='./wp' \
	--exclude='sitemap*.xml' \
	./pub/media/import/.htaccess \
	./pub/static/.htaccess \
	./var/composer_home/.htaccess \
	./var/composer_home/auth.json \
	./var/composer_home/packages.json \
	-zcvf ~/${PWD##*/}-$(date '+%Y-%m-%d-%H-%M').tgz .

See also:

Cleanup

Archiving