Skip to content

Instantly share code, notes, and snippets.

@gmanley
Last active December 14, 2015 14:39
Show Gist options
  • Save gmanley/5102114 to your computer and use it in GitHub Desktop.
Save gmanley/5102114 to your computer and use it in GitHub Desktop.
Quickly Host a Git Repository
# **Quickly Host a Git Repository**
REPO_ROOT='~/source/repos' # Can be anywhere
GIT_PROJECT_PATH='~/projects/my_cool_git_project' # Your local project using git
GIT_PROJECT_NAME=$(basename $GIT_PROJECT)
mkdir -p $REPO_ROOT
cd $REPO_ROOT
git clone --bare $GIT_PROJECT_PATH
cd $GIT_PROJECT_NAME.git
git update-server-info
cd -
python -m SimpleHTTPServer
# Give someone the url to clone it:
git clone http://grays-imac.local:8000/my_cool_git_project.git
@gmanley
Copy link
Author

gmanley commented Mar 6, 2013

I'm using the builtin python web server here as its simple to start up, however any http web server will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment