Is there a way to checkout a file in git and not allow anyone else to make changes to it until it is checked back in by the user that checked it out? I.e. Checking out in the true sense of the words.
Thx!
Is there a way to checkout a file in git and not allow anyone else to make changes to it until it is checked back in by the user that checked it out? I.e. Checking out in the true sense of the words.
Thx!
In the context of version control, this is usually called file locking or reserved checkout.
And no, there is no support for file locking in git. File locking is fundamentally incompatible with a distributed version control system (DVCS), because the whole point of a DVCS is that there can be many clones, which can be used independently of each other, and without communication. So in general, file locking is impossible because there is no central authority to manage the locks.
That said, you can layer file locking on top of git's structures. For example, gitolite supports file locking. However, there's no built-in solution.