cherrun
cherrun

Reputation: 2142

Collaborative programming with Git

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

Answers (3)

sensorario
sensorario

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

NominSim
NominSim

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

Robin Green
Robin Green

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

Related Questions