I want to apply version control system in our job, but there are som difficulties, because graphic designer should have access only to view templates (smarty) and CSS/JS, so he can't set up local copy of web application.
Application has those elements pulled to single directory called /front/
Current situation looks like this:
Main developer: own apache server on workstation, he does 90% work with PHP.
Second developer: work sometimes (little changes) by local network (changing files on main developer machine)
Designer: Working in home, has 开发者_如何学编程own separate domain with site-clone (let's call it designerworkarea.com) with FTP access only to templates & css.
Development/deployment looks like this:
Main developer code & test all PHP on his machine, then put sources to main production server (let's call it procutionarea.com) by FTP
Designer works on files "with FTP", se every change need to be uploaded and is seen at designerworkarea.com
To deploy frontend, admin on server copy view templates from /server/designerworkarea.com/front to /server/procutionarea.com/front (designerworkarea and productionarea are at same unix machine)
Of course, there is some synchronisation (1-2 a day) because main developer need to add new elements/templates to frontend of application, wich were be styled by designer.
As you can see, this is some mess. There would be no problem when anyone could have own LAMP stack with full sources - but designer can't have access to directories other than front - so he can't set up this web application on his local machine.
What will be best way to organise this working enviroment with GIT ?
Note 1: Designer should have possibility to see his changes immediatly, but not 'by commit', because there can be lots of try's before completing some small amount of work wich should be commited at once. And we don't want to have hundreds/thousands commits a day.
Note 2: At any moment there can be error found in view templates wich requires intervention of developer.
If you need for your designer to see at all time the result of his/her work, it is best to take advantage of the "Distributed" aspect of git, and have a clone of your repo used:
- as a staging area for the designer to push to
- as a source for deploying a "staging" web site (visible only by the designer)
That would allow the designer to:
- make tens of commits until a given feature looks right on a branch monitored and deployed on each commit on the staging web site
- squash his/her commits (in (or
merge --squash
to) a special branch that the developer can pull from in order to get back the latest design (without getting all the intermediate commits).
The point is: with a DVCS (like Git), you don't have to use only one repo for synchronization. You can have several, each with a different role.
精彩评论