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

How to view history of a deleted file in stash

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 8, 2012

There is some file that got deleted from our repository.
In fisheye you can bring up deleted files, and check its history.

Is there some equivalent function in stash ?

2 answers

1 accepted

3 votes
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2012

Hi Francis,

Stash can certainly show the deleted history of a file, but you have to first visit the file at the revision in which it still exists.

For example, viewing a file at the default branch (master) has the following URL:

https://$HOST/projects/$PROJECT/repos/$REPO/browse/$PATH

If the file does not exist, you will get a warning message to that effect. If you view that file at a specific branch the URL will look change to the following:

https://$HOST/projects/$PROJECT/repos/$REPO/browse/$PATH?at=$BRANCH

"$branch" in this example can also be the hash/sha of any commit. If the file exists at that revision you will see the contents and history as normal. You can find this another way if you navigate to the relevant commit and click the 'view source' button on the right.

This isn't ideal, and maybe we should add a 'show all' button on a non-existent file (or something) to help discover the full history. I'm afraid to say there isn't anything like that just yet.

Just as an aside, you can obviously do the same thing on the command line (if that's your sort of thing):

git log -- $FILE

The '--' here will force git to ignore the fact that the file does not exist in your working directory. You don't need to specify the branch/hash.

I hope this helps.

Charles

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 8, 2012

The only drawback is that you need to know when the file was available in some branch. But that's fine. I will add a feature request for the 'show all'.

Thanks,

daniellucena2 August 26, 2016

Thank you! you saved me!

0 votes
Thomas Hooper March 27, 2019

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events