git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
.PHONY: clean-pyc clean-build docs clean | |
define BROWSER_PYSCRIPT | |
import os, webbrowser, sys | |
try: | |
from urllib import pathname2url | |
except: | |
from urllib.request import pathname2url | |
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) | |
endef |
tar_fileobj = io.BytesIO() | |
with tarfile.open(fileobj=tar_fileobj, mode="w|") as tar: | |
my_content = "abdef".encode('utf-8') | |
tf = tarfile.TarInfo("my_file_name") | |
tf.size = len(my_content) | |
tar.addfile(tf, io.BytesIO(my_content)) | |
tar_fileobj.seek(0) |
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |