Using Git to manage a web site
Note: earlier versions of this howto depended on setting the git config variables core.worktree to the target directory, core.bare to false, and receive.denycurrentbranch to ignore. But these changes are not needed if you use GIT_WORK_TREE (which didn't work when I first wrote the howto), and the remote repository can remain bare.
Back on the workstation, we define a name for the remote mirror, and then mirror to it, creating a new "master" branch there.
$ git remote add web ssh://server.example.org/home/ams/website.git $ git push web +master:refs/heads/master
On the server, /var/www/www.example.org should now contain a copy of your files, independent of any .git metadata.
Read full article from Using Git to manage a web site
No comments:
Post a Comment