0

We have a project in git..We didn't branched out so far..Several check-ins has been went every day throughout the year..However we want to checkout with specific date now

Is it possible via Tortoise Git and Source Tree?

Please kindly let me know the steps.

Thanks

Odata Dev
  • 107
  • 8
  • You should be able to check out any commit you like, so I don't understand your problem. I typically use the commandline and `gitk` though, so maybe these pieces of software are a lot different. Please also don't ask two questions (Tortoise Git and Source Tree) in one. – Ulrich Eckhardt Mar 11 '20 at 06:22
  • Assume i have committed throughout the year..Now i want to checkout all the files till Sep 17,2019. How to do it? – Odata Dev Mar 11 '20 at 06:31
  • https://stackoverflow.com/search?q=%5Bgit%5D+checkout+date – phd Mar 11 '20 at 07:38
  • I would like to know whether it is possible via client - Tortoise Git or Source Tree – Odata Dev Mar 11 '20 at 11:06

1 Answers1

2

As mentioned in "How to checkout in Git by date?"; git reflog is not reliable

git rev-list has access to all your history:

git checkout $(git rev-list -1 --first-parent --before="2019-09-17 00:00" master)

To do so in Source Tree, for instance, you can use a custom action:

  • For Windows, the Custom Actions configuration is located in Tools > Options > Custom Actions;
  • For Mac, the Custom Actions configuration is located in Preferences > Custom Actions.

https://confluence.atlassian.com/sourcetreekb/files/785323500/785323477/1/1444967006147/CustomAction1.png

To run the custom actions, simply open up Actions > Custom Actions > Select your custom actions:

https://confluence.atlassian.com/sourcetreekb/files/785323500/785323480/1/1444967006069/CustomAction4.png

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250