Simple Elixir/Phoenix app acting as a Git Smart HTTP server.
In your application's config.exs :
config :exgitd, [repositories_root: "/tmp/"]
repositories_root is the directory where Exgitd will look for your repositories.
$ mix do: deps.get, compile
$ mix phoenix.start
Say I have a bare git repository in /tmp/myuser/myrepo.git
$ # This will create a `myrepo` directory with a clone of the repo:
$ git clone http://localhost:4000/git/myuser/myrepo.git
$ # This pulls the changes from the master branch:
$ git pull http://localhost:4000/git/myuser/myrepo.git master
$ # I made local changes that I commited, push them:
$ git push http://localhost:4000/git/myuser/myrepo.git master
You can also list the available repositories of a given user with a GET request:
$ curl -X GET http://localhost:4000/git/myuser/
myrepo.git
myotherrepo.git
And upload a file through the /file/ route:
$ curl -F "file=@MyFile" http://localhost:4000/file/myuser
Which will put it by default in :repositories_root/../files/
** If you're using it anywhere else than localhost, you should consider using https...**
##TODO
- No AUTH!
- No Error handling
- No tests
Articles used to base this code on.
Copyright © 2014 Adrien Anselme and contributors MIT license. See COPYING for details.