Reputation: 2142
Is there a way to lock a file when working with Git? Or how would I go about and notify co-workers that I'm currently changing a Java class so that they don't start working on it? Is there something in Git to prevent something like this to happen?
Upvotes: 3
Views: 262
Reputation: 21668
You need a branch. Only you need this modifications? You do not need to share it with others. Create a local branch and work with it.
Upvotes: 0
Reputation: 8511
Ideally you'd be able to edit the file while co-workers also edit it, and git will help you merge your changes together. File locking isn't something Git allows, they favor good communication and collaboration instead.
Upvotes: 2
Reputation: 33093
No, it's not possible to lock files in Git, but Veracity is an alternative to Git that supports locking. However, even there, it is intended to be used for binary files, not text files.
Upvotes: 1