Skip to content

Instantly share code, notes, and snippets.

@datagrok
Last active April 21, 2023 07:33
Show Gist options
  • Save datagrok/5080545 to your computer and use it in GitHub Desktop.
Save datagrok/5080545 to your computer and use it in GitHub Desktop.
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.
@radeksvarz
Copy link

Nice. However you still have to expose your port.

I rather use git bundle as described here: https://git-scm.com/blog/2010/03/10/bundles.html

It also solves the issue when you do not want to be online at the same time.

@olejorgenb
Copy link

For anyone wondering why simply running a http server in the repo directory is a bad idea: you have to ensure the repo is "packed" at all times by periodically running git repack, otherwise the clients will get some random old state of the repo

@jennings
Copy link

A new built-in command git-serve was added in Git 2.18, so the alias "serve" no longer works. Changing the alias to "server" is a simple workaround.

@neomafo88
Copy link

404 Not Found
nginx/1.18.0

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