Git check time

I am looking for one git command (if possible) to check files from one repository at a specific time (for example, the time of my local branch).

Scenario: I checked Branch1 at a specific time, maybe 2 days ago (12/11/2015 19:05). I want to check out another branch, i.e. Branch2 from 2 days ago (12/11/2015 29:05 10 minutes after the check time for Branch1 ).

How can i achieve this?

Instead of a date, I can use a unix timestamp if that is easier.

If I use " git log -1 --format=%ct", he will give me a timestamp. I can then add 10 minutes to this timestamp and use the command below to check.

git archive --format tar --remote <HUB>:<REPO> master:`dirname <FILEPATH>` | tar -xO <FILE> > log_file.git

Is this possible in one team?

+4
source share
1 answer

Git stores the time of each commit in the repository, but the storage in the repository is not based on the time changes are made. The git repository data is structured based on the changes themselves.

You cannot rely on the repository to apply each commit to the store in chronological order. For example, you could select an older change from another branch to the current branch, and the commit date would be saved as the original, but the date of the previous commit would be later than this cherry one.

Now it was just for explanation. In your case, I hope that you know how you made changes to your repository. However, git will not let you choose based on time.

git log, , , , .

, , :

git checkout <hash> -b newbranch
0

Source: https://habr.com/ru/post/1615558/


All Articles