1

We are going to develop a webapp with a MVC framework. We have developers and designers in our team. We want to use git. Is there any way designers could only see some directories of the project? (views). I dont want designers loking and accidentaly changing other files than views.

Alberto
  • 11
  • 1
  • I mean, is it possible to isolate some directories in git? I dont want all people clone and get all the code (M, V and C parts). Designers must only take V parts and push to a development server where intregrated code could be tested. – Alberto Oct 30 '11 at 11:58

2 Answers2

1

One of the possible options is to use Git subtrees (or submodules, but I personally dislike them, see linked question for a list of reasons). Put views into a separate Git repo, and pull it as a subtree in developers main repo which is not accessible to designers.

Or keep everything in a single repo, but deny any commits to M and C parts from designer users in a pre-commit hook (and/or in pre-receive hook on server if you're paranoid).

You may also do a sparse checkout with Git, but I personally think that other two solutions are more practical.

Community
  • 1
  • 1
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
0

Make two different repos for code and for designers. You could also use Submodules to group the sub projects and track them together; but I have not used that so I cannot give any specific hints.

On the other hand, if you adopt a "git style" way of setting up the repositories (e.g. each user have their own private public mirror of their repository; where everyone has read access but only the owner has write acccess. And if you want, a canonical (master/trunk) repo if you want where only trusted developers have write access) accidental modifications should not be a big problem. You can just pull from the designers repo and see if it makes sense and correct errors before merging it into the "canonical" master branch.

Stein G. Strindhaug
  • 5,077
  • 2
  • 28
  • 41
  • do you mean git submodule? I am relative new with git. I have been loking a way to isolate code. – Alberto Oct 30 '11 at 12:06
  • If each part of the project can be compiled/deployed separately (using Ruby on Rails or PHP this may be the case) you don't even need to group them together using submodules. If the sub parts have to be compiled together (when using maven this may be the case) you probably should look at submodules). It depends... :) – Stein G. Strindhaug Oct 30 '11 at 12:20