I want to know when a specific piece of code in the file was added to depo.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.