Reputation: 293
I know locking files or directories in git can be problematic. But right now we have had a few developers working on a project in git and they have edited the core files for a web application like Magento or Wordpress. We were then faced with issues when upgrading or using third party plugins because the core files/directories were modified.
Is there a way in git to lock certain files and directories to prevent developers from editing core files? Or is there a better method to stop developers from editing core files? We will need a way to unlock them so we can perform upgrades.
Upvotes: 0
Views: 110
Reputation: 4626
It's not in Git's design philosophy to handle access-control to certain parts of the working tree.
A simple solution is to split your project into different repositories, where access control is easy to setup. To do this, have a look at Git Submodules.
Upvotes: 0
Reputation: 175098
Don't check your libraries into source control. It's as simple as that.
You don't want WordPress's files to be modified? They shouldn't be tracked by a version control system whose entire purpose is to allow files to be changed in a controlled way.
Are you building a plugin? Only check that in. A theme? Only check that in.
Deploy your files to the correct subfolder of WordPress. The only thing that's related to the actual library that should be tracked is the WordPress version you're building against.
Upvotes: 1