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

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events