Is there any way to tag a git repository based on the commit time?
For example, 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 that tagging may happen retroactively a few hours after release.
My 开发者_StackOverflowrepository is on a Windows XP system and I'm using msysgit to access git.
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
精彩评论