开发者

Add git tags based on commit time

开发者 https://www.devze.com 2023-01-13 00:34 出处:网络
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 iss

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
0

精彩评论

暂无评论...
验证码 换一张
取 消