Skip to content

Instantly share code, notes, and snippets.

@janakaud
janakaud / git-serve.py
Created September 12, 2020 12:57
Simple CORS-enabled Python2 local Git server utilizing git-http-backend
#!/usr/bin/python
import os
os.environ.__setitem__('GIT_HTTP_EXPORT_ALL', '1')
from CGIHTTPServer import CGIHTTPRequestHandler, test
import SimpleHTTPServer
class GitHandler(CGIHTTPRequestHandler):
# https://stackoverflow.com/questions/47758247/local-embedded-http-server-that-can-respond-to-git-commands#47797885