How may I track changes of a single file using bitbucket?

Alain Ross June 7, 2023

I want to know when a specific piece of code in the file was added to depo.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 8, 2023

Hello @Alain Ross and thank you for reaching out to Atlassian Community!

If you would like to track the evolution of a range of lines in a file of your repository throughout the history, I would suggest using git log command in a local clone of the repository.

You will need to execute the command in your terminal inside the local clone of the repository: 

git log --pretty=short -u -L 10,15:my_file_.txt

In this example, git will print all the commits that modified lines 10 through 15 in a file named my_file_.txt. It will also show the diff containing the changes that each commit introduced. With this information, you can go through that list of commits and diffs and find which one modified the piece of code you are interested in.

Hope that helps! Let me know in case you have any questions.

Thank you, @Alain Ross !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events