#!/bin/bash REPO_PATH=$1; DAYS=$2; PUSH=$3; if [ ! -d ${REPO_PATH} ];then echo ${REPO_PATH} 'is not a valid path' exit fi if [ -n "`echo ${DAYS} | sed 's/[0-9]//g'`" ];then echo ${DAYS} 'is not a valid number' exit fi cd ${REPO_PATH} git status > /dev/null 2>&1 if [ $? -ne 0 ];then echo ${REPO_PATH} 'is not a valid repository' exit fi echo -e "\nGitfool is generating your commits, please wait...\n" for((i=0; i<=${DAYS}; i ++)) do COUNT=$(($RANDOM%15)) date -v -1d > /dev/null 2>&1 if [ $? -ne 0 ];then THIS_DATE=`date -d "${i} days ago"` else THIS_DATE=`date -v-${i}d -R` fi for((c=0; c<=${COUNT}; c ++)) do git commit --allow-empty -m "update at ${THIS_DATE}" --date="${THIS_DATE}" > /dev/null 2>&1 done done if [ "${PUSH}" == "--push" ];then git push fi echo -e "\n\n finished your Gitfull !!!"