-1

How to truncate the old history in the git repository while preserving the date/time of commits?

I have
A-B-C-D-E-F-HEAD

I need
D-E-F-HEAD

I've tried this:

git clone file://e:\repo --shallow-exclude TRUE_START

TRUE_START — this is my tag.
How do I remove the old history from a git repository?

I got a truncated repository, but couldn't push it to GitHub, because the repository is shallow and the first commit has the grafted mark.

sotrainee
  • 1
  • 1
  • 1
    Duplicate with [How do I remove the old history from a git repository?](https://stackoverflow.com/questions/4515580/how-do-i-remove-the-old-history-from-a-git-repository) ? Remember: I am not an expert on GIT, and I do not have a backup.... – Luuk Aug 31 '23 at 17:10
  • @Luuk, this is no duplicate. It's important to me to preserve date/time of commits. – sotrainee Sep 01 '23 at 09:35
  • @Luuk. But I'll study this link again, maybe I didn't understand everything there – sotrainee Sep 01 '23 at 09:42
  • The meaning of the word [truncate](https://www.dictionary.com/browse/truncate) is: "to shorten by cutting off a part". But you want to keep all history ? Then this question is probably a duplicate of [How do you merge two Git repositories?](https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories) (Definition of [merge](https://www.dictionary.com/browse/merge): "to combine or unite into a single" ) – Luuk Sep 01 '23 at 12:20

0 Answers0