chopin_is_the_best
chopin_is_the_best

Reputation: 2101

Generate random number withing a git commit statement

I can commit and push something in the past using:

git commit --date="25 day ago" -m "some message" 

I would like to generate a command that takes the parameter --date="___ day ago" as a random date in the last 360 day ago interval.

How can I approach the problem?

Upvotes: 0

Views: 573

Answers (1)

j6t
j6t

Reputation: 13507

If you are using bash, you can:

git commit --date="$(( $RANDOM % 360 )) days ago" -m "some message"

Upvotes: 2

Related Questions