Home > Enterprise >  Generate random number withing a git commit statement
Generate random number withing a git commit statement

Time:02-06

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?

CodePudding user response:

If you are using bash, you can:

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