4

We are performing the following

    git checkout copy_from_branch
    git checkout branch_getting_changed
    git reset --hard origin/copy_from_branch

Now, branch_getting_changed becomes exact copy of copy_from_branch in terms of commits.

Since they are exact copies, we are not able to check the TIMESTAMP of exactly when the reset action was performed on the branch_getting_changed.

codeaprendiz
  • 2,703
  • 1
  • 25
  • 49

1 Answers1

3

If the reset is executed locally, in your local git repository, you can then refer to git reflog

git reflog --date=iso

You will see the reset entry, and its associated date.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks a lot for this answer. This will work on local. However this event should also be logged on remote if someone else wants to check when reset was executed. Like if we could get similar result using github API or if someone else checks out the branch again on different machine and then runs this command. – codeaprendiz Oct 26 '20 at 12:07
  • @codeaprendiz That depends on the remote Git repositories hosting service: https://stackoverflow.com/a/53343686/6309 records a force push on PR branch. For the rest, check the push events: https://stackoverflow.com/a/28958418/6309 – VonC Oct 26 '20 at 12:53
  • 1
    @codeaprendiz You are welcome. Also of interest: https://stackoverflow.com/a/28885864/6309 and https://stackoverflow.com/a/15030429/6309. – VonC Oct 26 '20 at 12:58