Concatenative language
Concatenative topics
Concatenative meta
Other languages
Meta
== How to publish a Git repository == To set up a repository on a server you should clone the existing Factor repository using the '--bare' option: [shellscript{git clone --bare git://factorcode.org/git/factor.git factor.git}] A bare repository is one without a checked out working copy of the code. It only contains the git database. As a general rule you should never push into a repository that contains changes in the working copy. To ensure this doesn't happen, we're making the server repository a bare repository - it has no working copy. Copy the 'factor.git' directory onto your server. I put it in '%/git/factor.git%'. Now if you have changes on your local machine that you want to push to your repository you can use something like: [shellscript{git push yourname@yourserver.com:/git/factor.git}] If you want to push changes from a specific branch in your local repository: [shellscript{git push yourname@yourserver.com:/git/factor.git mybranch:master}] To publish the remote repository you have two options. You can publish via the HTTP protocol, or via the git protocol. The first is slower but usable by people behind restrictive firewalls, while the second is more efficient but requires an open port. I suggest doing both. To publish via HTTP, you must make the file '%hooks/post-update%' executable: [shellscript{chmod +x /git/factor.git/hooks/post-update}] This gets executed whenever something is pushed to the repository. It runs a command '%git-update-server-info%' which updates some files that makes the HTTP retrieval work. You should also run this once manually: [shellscript{cd /git/factor.git git-update-server-info}] Now make the %/git% directory published via your webserver (symbolic link to it in the server's doc-root). People can pull from the repository with: [shellscript{git pull http://yourserver.com/git/factor.git}] To set up the git protocol you need to run the '%git-daemon%' command. You pass it a directory which is the root of your git repositories. It will make public all git repositories underneath that root that have the file '%git-daemon-export-ok%' in it. So first create this file: [shellscript{touch /git/factor.git/git-daemon-export-ok}] Run the daemon with: [shellscript{git-daemon --verbose /git}] The '%--verbose%' will give you output showing the results of connecting to it. You can set it up to automatically run using whatever features your server OS has. Now people can retrieve via the git protocol: [shellscript{git pull git://yourserver.com/git/factor.git}] %factorcode.org%'s repository is accessible from both protocols: [shellscript{git clone http://factorcode.org/git/factor.git git clone git://factorcode.org/git/factor.git}] You can also browse it using [[http://gitweb.factorcode.org|gitweb]]. Article originally from [[Chris Double]] at [[http://www.bluishcoder.co.nz/2007/09/how-to-publish-git-repository.html]]
Describe this revision:
Save