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

How can we download a repo containing files with their last modification date

Wonderketchup April 16, 2018

Downloading a repo either in zip or tar.gz format sets all files date with download date.

How can we preserve last modification date of these files by downloading and not cloning?

1 answer

1 accepted

0 votes
Answer accepted
Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2018

Hi Tanguy

 

The contents of the file will have their date modified attribute set according to the last performed commit against the repository.

In addition, are you referring to Bitbucket Cloud or Server?

Wonderketchup April 16, 2018

Hi Rodrigo,

I'm referring to Bitbucket Server.

When we download, we get all files with same date. With the current date.

Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2018

Hey Tanguy

 

What Bitbucket version are you running?

Wonderketchup April 17, 2018

5.7.1

Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2018

Hey Tanguy

I've performed a test on my local instance using Bitbucket v 5.7.1 version and it seems that this is the expected behaviour: 

The downloaded file will have the Date Modified attribute set to the day that the file was downloaded, and the contents of the file will have their date modified attribute set according to the last performed commit against the repository.

Regards!

Rodrigo

Wonderketchup April 17, 2018

Hi Rodrigo

I've tested on windows and on linux, when files are extracted, OS gives them date of download and not date of "last modified". 

Tanguy

Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2018

Hello Tanguy.

 

Can you share a screenshot showing all files with the same date as you've mentioned?

 

Best

Rodrigo

Wonderketchup April 18, 2018

downloaded_on_host.pngbitbucket_repo.png

Wonderketchup April 20, 2018

Are the screenshots enough?

Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2018

Hi Tanguy! Thanks for the screenshots sent.

As I've mentioned before, after extracting the files from the zip file, their date modified attribute will be set according to the last performed commit against the repository.

 

Take a look at my example on the screenshot attached. On my repo, the last commit against the repo was on Abr 5. This is the expected behaviour.

image.png

In your case, the last committed date against the repo was made on Feb 7th.

 

Regards

Rodrigo!

Wonderketchup April 25, 2018

Thanks Rodrigo. Our problem is that we want original 'last modification date' of files and not the date of commit which here is the last commit date.

This might be internal to git? Any idea on how we could retrieve those original modification dates?

Kind regards,

Tanguy!

Alan Holden January 9, 2024

>This is the expected behaviour.

Why?? What is the sane reason for THIS being the expected behavior?

If I have made a change to just one file out of a hundred, commit that change, and then download a zip of the repo; how do I benefit from not knowing which of the 100 files within needs to actually be extracted according to its' true mod date?

The other 99 files were not modified. Why was it deemed correct behavior to change the mod date of those files? It's a lie! :-]

Is this a limitation of the git specification? Some third-party software you're using?

Not angry. Just amazed, very curious and unable to write my parser.

Also sorry about the 5 year delay...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events