Skip to content

Instantly share code, notes, and snippets.

@Nikoloutsos
Created January 8, 2026 23:56
Show Gist options
  • Select an option

  • Save Nikoloutsos/c227c00b00c223393321306346791310 to your computer and use it in GitHub Desktop.

Select an option

Save Nikoloutsos/c227c00b00c223393321306346791310 to your computer and use it in GitHub Desktop.
Script for making old commits - making your graph look greener πŸ’š
#!/bin/bash
# Starting timestamp: January 1, 2025 00:00:00 UTC
start_timestamp=1735689600
# Ending timestamp: January 1, 2026 00:00:00 UTC
end_timestamp=1767225600
# Current timestamp
current=$start_timestamp
# Counter for commit messages
counter=1
# Loop through timestamps
while [ $current -le $end_timestamp ]; do
# Create a dummy change
echo "Commit $counter at timestamp $current" >> activity.txt
# Stage the change
git add activity.txt
# Commit with custom date
git commit --date=$current -m "Activity commit #$counter"
echo "Created commit #$counter for timestamp $current"
# Generate random increment between 0.6 and 2 days in seconds
# 0.6 days = 51840 seconds
# 2 days = 172800 seconds
# Range = 172800 - 51840 = 120960 seconds
random_increment=$((51840 + RANDOM % 120961))
# Increment timestamp by random amount
current=$((current + random_increment))
counter=$((counter + 1))
done
echo "Done! Created $((counter - 1)) commits"
echo "Run 'git push' to push to your repository"
@Nikoloutsos
Copy link
Author

Output:
CleanShot 2026-01-09 at 01 56 31@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment