It is handy to be able to quickly create a git repo server with anonymous clone and push access rights.
Note: Anyone!! with access to the server will be able to clone and push to the repo
Is super handy for personal use, in-house networks, or networks behind a firewall where security
is less of an issue.
Create the server git directory
Create a test repo
Bring up the git server daemon
mkdir repos
cd repos
git init --bare --shared=all foo.git
git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack
Only need to do this once.
See stackoverflow
git config --global sendpack.sideband false
Clone the repo
- For now assuming the server is on your machine (localhost)
- If on another machine, change
localhost
to the IP or name of the server
git clone git://localhost/foo.git
cd foo
Create readme.md file using your chosen editor, then :
git add .
git commit -m "Initial Commit"
git push