Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

View history of renamed file

Oleksandr Serdiuk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 3, 2019

Hi,

I need to see history (using bitbucket web interface) of a file that has been renamed

2019-06-04_9-20-04.jpgbut when I go to "Source" I see that all previous commits of this file (for the period before it was renamed) have disappeared:

2019-06-04_9-25-58.jpg

Can I somehow see the full history of the file?

Thank you in advance.

2 answers

1 vote
Adam Homann
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2021

I was worried too, turns out it's a simple fix, and relates to the --follow flag in git.

When you right click a file in Sourcetree, and select "Log Selected..."  this new window that pops up, you will see the "Follow renamed files" at the bottom left of this window. Select it, and viola, you can see all the commits even back when the file had a different name.

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 5, 2019

Hello Oleksandr and welcome to the Community!

To ensure we address the proper issue, there was a file within your repo which was renamed and once said the file was renamed the entire git history for the old filename is now removed, and only new commits are showing for the newly named file. With this said, this is more of a functionality of how git functions with file renames. This can be due to the nature of the rename which git may treat as a create a new file (new file name) and delete old file (old file name). There are methods within git to make a file rename be treated as a move instead of creating then delete. There is an excellent StackOverflow post which describes similar git process which may be found at How to make git mark a deleted and a new file as a file move?

With this said, if you’re using the Web UI to rename a file and notice then that the history is removed then most likely you’re impacted by the following bug; File history should follow copies and renames (BB-681). If this is the case, please vote and watch this request to receive future updates on its status.

I hope this proves helpful and adds some clarity to file names and commit history.

Regards,
Stephen Sifers

Ken_Walker
Contributor
June 21, 2019

Never mind, I now see your link to the open issue. I added my vote to hopefully get it implemented soon.

Like Stephen Sifers likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events