Is there any file locking process in bitbucket?

If more than one users want to change same file at a time, then how can one user lock the file before it's use. Also another user who wants to change the same file, how he knows about  the file status, is it locked by any user or not.

2 answers

Hi Guy,

the question is now on year old... What about this feature!?? We need because my team used in the past a system that prodived this feature and they absolutly want to have it too on Bitbucket server. It is still a must even when the git purist mind it is not necessary.

May be as a motivation. Gitlab already implement it:


Best regards,



Hi Swati,

Git (the most popular version control system supported by Bitbucket) doesn't natively support file locking, so neither does Bitbucket.

However, the Bitbucket team have announced that they intend to launch support for a Git extension named Git LFS (Large File Storage). LFS doesn't yet support file locking but has an outstanding proposal to include it in a future release, so you may see Bitbucket supporting locking in some form in the future.



Yes, as Tim said. It's important to understand that Git and Mercurial use an optimistic concurrency model that lets multiple users freely change the same set of files. Git then (almost) automatically merges your changes. This model is very different from lock-based version control systems like (now discontinued) Visual Source Safe where developers lock files so that only one developer can change a file at any one time.

The optimistic concurrency model is good if you are not dealing with binaries.  How do you manage files similar to Word .doc files?  This is for more than just .doc files, but it is a good example.  How soon is the LFS system going to be available.



Yepp. we also need such a locking feature to be able to avoid simultanous changes of binary files like MS excel.

Git and Mercurial don't have any means to accomplish this, nor are there any plans to offer this AFAIK. However, it would be possible for a hosting service like Bitbucket or GitHub to build something on top of it, like what Gitolite has done:

If this is something you'd want us to implement, please head over to our issue tracker and raise a feature request:

Hi ,

We are using bitbucket 4.10.2 with LFS enabled.
Could any one help how can we make use of the feature "File Locking" with LFS enabled ?


Bitbucket does not support the locking yet.
See BSERV-9623 for more information.

Besides that information, locking can be enabled by adding "lockable" to the filetype-line in the .gitattributes file. E.g.:
*.exe filter=lfs diff=lfs merge=lfs -text lockable

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

690 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you