The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

all files new date after merge

Davio Ulber
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!
July 12, 2023

Hello,

after I merge a branch into the master branch (sourcetree), all files at the destination path (local C:)

get a new date -> date from the merge. Is there a possibility to prevent that behavior? I need the files to keep the date, on wich I changed somthing on them.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Martin Runge
Community Champion
August 11, 2026

Hi @Davio Ulber

This is expected Git behavior rather than something specific to Sourcetree. Git does not store file modification dates. It only tracks content. So whenever Git writes files to your working copy, like during a merge or checkout, your operating system stamps them with the current time. That is why every touched file shows the merge date.

If you need the original dates back, you could look at the community script git-restore-mtime. It walks the history and resets each file's date to the last commit that changed it. You run it once after the merge.

Is this still an open question for you, or did you already find a way around it?

Cheers, Martin

TAGS
AUG Leaders

Atlassian Community Events