0

Here's the thing:

We are developing and we push and commit etc.

Our designers just finish an image edition and it would be nice for the workflow, to allow the designers to place their images themselves.

All application images are on a single place.

I don't mind setup the designers computers in order for them to do "git push", however I would feel safer if, they do it, only on that specific image folder.

Perhaps a gitignore declaring to ignore everything except the contents of image folder? Or more cleanly, we can setup a git user somehow ? Or should this be a job for the ssh access to this user?

As anyone have done such a thing ? If so, what options do we have?

MEM
  • 30,529
  • 42
  • 121
  • 191

1 Answers1

1

Git does not really support folder-based access control natively.

The preferred way to do this is to disallow them from pushing to your master branch and let them push to a "private" branch instead from which you then merge/rebase the commits onto your master/development branch.

If that's not an option you could most likely use a Git hook to reject the push in case it modifies anything outside the image folder. Since the hook needs to run on the remote side to be effective you need to use a pre-receive or update hook. See the Git docs for more information on these hooks.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
  • Thanks. I would prefer to hook option, sending the user a message. But what would trigger it ? pre-commit ? - Any more details regarding the way we may code that hook ? – MEM Apr 16 '13 at 16:23
  • 1
    Since you want to enforce a restriction you need to do it on the remote repository. So commit-specific hooks are not an option. See http://git-scm.com/book/en/Customizing-Git-Git-Hooks#Server-Side-Hooks for the hooks you can use. This script might be a good point to start implementing your own hook to check the changed paths: http://stackoverflow.com/a/2570098/298479 – ThiefMaster Apr 16 '13 at 16:24
  • Thanks a lot. I will have a look. – MEM Apr 16 '13 at 16:28