views:

35

answers:

1

Is there any way to tag the git repository based on the commit time.

Ex: If I have the release time, I want to tag all the repositories used in the release as of the release time. The main issue is the tagging may happen few hours after the release.

My repository is in a Windows XP system and I'm using msysgit to access git.

Thank you

+3  A: 

You could write a script that uses the --before option to git rev-list to get the last commit in a branch before the release timestamp, and then tag that commit.

git rev-list -n 1 --before=<timestamp> master
Amber