Skip to content

Instantly share code, notes, and snippets.

@marka2g
Created March 8, 2013 16:59
Show Gist options
  • Save marka2g/5117963 to your computer and use it in GitHub Desktop.
Save marka2g/5117963 to your computer and use it in GitHub Desktop.
Quickly Host a Git Repo - From Gray
# **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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment