php - Migrating a production site with no VCS at all to Git -


i thought throw out there , see if solid advice on this.

i've got production site rather large code base , have installed git on it, same test site. , i've got local box point of integration. our team push local box , little gnomes come , take off our different servers - or @ least that's closest i've come implementing git.

i don't have slightest clue begin. i've got big, finicky, legacy codebase scared touch on day. git meant starting point of big cleanup process, don't know how started.

i thinking of creating bare .git repo based on production docroot (with applicable .gitignore stuff) , cloning on test , development environments, individuals clone off dev , work, pushing dev , somehow magically telling git update docroot when changes bare repo made.

i going install git-flow on development (can't work on production server), , push production. since branches @ end of day, figured away not using git-flow on prod/test servers.

this seems , good, don't know if should pushing test/prod, or pulling dev test/prod. maybe straight git init in production docroot? create .git directory , git init that? git init git giggidy giggigdy...

insights appreciated.

edit

here's ended doing, else find useful.

downloaded current production code development server (lamp) set .gitignore files , ran git init within directory , peformed initial import/commit
on staging/production servers:
created yourname.git directories , created bare repositories git init --bare
set worktree /path/to/my/public_html, set bare false, , set receive.denycurrentbranch ignore
added line hooks/post-receive: git checkout -f making sure git user had permission write worktrees

back on development server:
git remote add [staging|production] ssh://myuser@myserver/path/to/my.git
git push [staging|production] master

to update production , staging sites, simple git push [production|staging] , don't have fuss hiding .git directory public view.

sources: http://www.deanoj.co.uk/programming/git/using-git-and-a-post-receive-hook-script-for-auto-deployment/
http://toroid.org/ams/git-website-howto

hope helps someone!

edit again
also, works best on 1.7.3.3 or later. i'm running virtualized ubuntu box development , ran issues committing on samba. after fighting couple of hours, read issue fixed in 1.7.3.3. on 1.7.3.1.

if you're not interested in getting heavier deployment solutions capistrano can set post-receive hook on bare repository checks out latest changes production docroot. set separate hook both dev , production. here pretty guide doing this.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -