Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Need to restrict user to access old versions of bitbucket files


We have a file with the user name and password and some text in a repo.
we committed that repro later we under we should not put password public.
So we made changes to the file and removed the password.
But still, if we open the file history/versions if we check the old version the password will be still avalibile.
since we need to restrict that version to be accessed by users. 

1 answer

0 votes

Hi @Raj Kumar Samakari and welcome to the community.

It is not possible to restrict access to certain files or commits in a repo.

My suggestion would be rewriting history to remove this file from the repo's history (and afterwards commit it again, without the password).

One tool you could use for removing the file from the repo's history is BFG:

If you check the examples on that page, it is possible to use it with the flag --delete-files in order to delete the file from the repo's history.

Please note:

  • Rewriting history means that the commit hashes of the repo will change. It would be good to communicate this with your team, and also ask them to take a new clone of the repo after you finish this process, to avoid pushing any of the old commits back.
  • Make sure you take a backup of the repo prior to doing any changes (a clone with the --mirror flag, other than the one where you use BFG) in case anything goes wrong, as rewriting history involves destructive operations. I would also suggest pushing any changes to a newly created empty repo first, to check if the repository is in good shape before you push to the repo you are working on.

Please feel free to let me know if you have any questions.

Kind regards,

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events