Multiple Git repositories in one directory

I would like to deploy a directory to multiple developers having different permissions. So this is one thing Git cannot do. What about creating two repositories in one directory and assigning them different file lists by excluding files managed by the other repository with the .gitignore file.

Example: /www/project/.git for all files except in /www/project/css
-> only files in this directory

  • Vagrant - paver devstack error: “ Not a directory”
  • Remove Git from my mac?
  • Resolving conflict in git
  • How to see contributor's email address on Git commit chain?
  • How can I change a specific font color in git?
  • How do I check out a certain revision with Git?
  • Has anyone tried this solution? Or are there any better ways to handle this issue?

  • git repository gives 403 error while connecting from jenkins in linux
  • Pushing a Git source tree, not just a repository
  • What is the Working Directory of a GIT repository?
  • Git Changes to file lost after merge with remote (SourceTree, GitHub)
  • git merge -s recursive -X ours vs git merge -s ours?
  • REJECTED_NONFASTFORWARD error in git remote push Netbeans
  • 3 Solutions collect form web for “Multiple Git repositories in one directory”

    A less annoying approach than git-submodules (which are a pain to use) is gitslave Gitslave creates a group of related repositories—a superproject repository and a number of slave repositories—all of which are concurrently developed on and on which all git operations should normally operate; so when you branch, each repository in the project is branched in turn. Similarly when you commit, push, pull, merge, tag, checkout, status, log, etc; each git command will run on the superproject and all slave repositories in turn. This sort of activity may be very familiar to CVS and (to a lesser extent) Subversion users. Gitslave’s design is for simplicity for normal git operations.

    I’ll also point you to etckeeper which does track permissions. It has its own peculiarities which may or may not make it usable for you.

    Finally, I’ll note you can have a custome post-checkout script which sets the appropriate permissions on the appropriate files/directories.

    It sounds like you want submodules. Any sub directories from the main repo can be submodules which are different git repositories.

    I suspect you’re much better off permissioning your developers for comimits in either/both repositories. See also this server fault question.

    Git Baby is a git and github fan, let's start git clone.