Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:13:37+00:00 2026-05-15T16:13:37+00:00

How to configure git and gitolite to allow specific user to change just files

  • 0

How to configure git and gitolite to allow specific user to change just files that are inside specific directory?

e.g. files in origin master branch:

/dir1/
/dir2/file1
/dir2/file2
/dir3/file1

User kathrine, allow to change only /dir2/file1 and /dir2/file2

$kathrine: git clone git@example.com:test.git

results in:

/dir2/file1
/dir2/file2

Are there any per-dir directives in gitolite.conf or shall I configure git with new branch for this user?

I just don’t want graphics designer to have access to the source code files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:13:38+00:00Added an answer on May 15, 2026 at 4:13 pm

    2010: For Gitolite 2 (might have changed for gitolite 3)

    No (meaning a dedicated branch with the right content needs to be created).

    As the author of gitolite himself put it:

    I am the author of a project called gitolite that does an excellent job of branch-level access control for multiple git repositories on a central server.
    My target “market” is precisely corporate users of git.

    So far, I have not seen a situation where read-access needs to be restricted to ortions of a repo (git can’t do that anyway).

    [well sparse checkout might help, but it is not easy anyway)

    Write-access does often need to be restricted, and gitolite can let you restrict:

    • both by branch name (e.g. only the QA lead can push a commit series into the “QA-done” branch)
    • or by filename (e.g., only the team lead can make changes to the Makefile and files in src/very-important-and-critical-module).

    See the section “security, access control, and auditing“, and here is an example of write access:

    The conf/example.conf file has all the detailed syntax:

    repo foo
            RW+ = lead_dev # rule 1
            RW = dev1 dev2 dev3 dev4 # rule 2
    
            RW NAME/ = lead_dev # rule 3
            RW NAME/doc/ = dev1 dev2 # rule 4
            RW NAME/src/ = dev1 dev2 dev3 dev4 # rule 5
    

    each file touched by the commits being pushed is checked against those rules.

    • lead_dev can push changes to any files,
    • dev1/2 can push changes to files in “doc/” and “src/” (but not the top level README),
    • and dev3/4 can only push changes to files in “src/“.

    That being said, the tough question remains, as the OP puts it:

    how do I create new branch witch some selected files only, and delete the previous commits, so the graphic designer could not access them, and see only the selected ones after the clone?

    General principle:

    create ‘graph_designer’ branch at a point in history where those files weren’t present.

    From there, two choices:

    • either reorganize your current commits (git rebase --interactive) in order to have first the one with only dir2 files (and then commits impacting any other directory)
    • or, if the first choice represents too much work (or isn’t possible because those commits have already been pushed and pulled in other repos), simply copy and add the relevant files in that new branch.
      That means, no past history for those files, but they might not need that history right from the beginning.

    That ‘graph_designer‘ will be the only branch allowed to be cloned, and won’t contain any history with non-authorized files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like the fine-grained commits that the git index allow, i.e. the staging of
in a git-svn repo, git status doesn't show the usual # On branch master
How do I globally configure git to use a particular editor (e.g. vim )
Is it possible to configure nHibernate to connect to Paradox database ( *.db files)?
How would one configure trac to allow anonymous submission of tickets?
I'm trying to configure a dedicated server that runs ASP.NET to send mail through
Is it possible to configure Git to use my configured difftool with git add
I'm trying to configure GIT on my Windows XP machine, but SSH keeps creating
I have a project hosted on git.debian.org (alioth) and I'd like to configure a
Is it somehow possible to ignore certain files during git diff? I'm specifically interested

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.