-
-
Save cuuupid/0513d98556021d738c0cb72be0a63615 to your computer and use it in GitHub Desktop.
# a million commits | |
for Y in {1999..2018} | |
do | |
mkdir $Y | |
cd $Y | |
for M in {01..12} | |
do | |
mkdir $M | |
cd $M | |
for D in {01..31} | |
do | |
mkdir $D | |
cd $D | |
for i in {01..12} | |
do | |
echo "$i on $M/$D/$Y" > commit.md | |
export GIT_COMMITTER_DATE="$Y-$M-$D 12:$i:00" | |
export GIT_AUTHOR_DATE="$Y-$M-$D 12:$i:00" | |
git add commit.md -f | |
git commit --date="$Y-$M-$D 12:0$i:00" -m "$i on $M $D $Y" | |
done | |
cd ../ | |
done | |
cd ../ | |
done | |
cd ../ | |
done | |
git push origin master | |
git rm -rf 20** | |
git rm -rf 19** | |
git commit -am "cleanup" | |
git push origin master |
@pshah123 thanks for this!
I updated it a bit so that you don't have to hardcode the year and it will just use date +"%Y"
to get current year and placed all the years directories into one directory to be deleted.
https://github.com/ThuyNT13/git-xploit
Cheers!
I added a bit of functionality to it that ensures a random number of commits is placed in. When I first ran the original script it was showing 12 commits on each day.
for Y in {2016..2018} do mkdir $Y cd $Y for M in {01..12} do mkdir $M cd $M for D in {01..30} do mkdir $D cd $D for i in $(seq 1 $((1 + RANDOM % 10))) do echo "$i on $M/$D/$Y" > commit.md export GIT_COMMITTER_DATE="$Y-$M-$D 12:$i:00" export GIT_AUTHOR_DATE="$Y-$M-$D 12:$i:00" git add commit.md -f git commit --date="$Y-$M-$D 12:0$i:00" -m "$i on $M $D $Y" done cd ../ done cd ../ done cd ../ done git push origin master git rm -rf 20** git commit -am "cleanup" git push origin master
@pshah123 I just read your article here https://hackernoon.com/how-to-hack-github-kind-of-12b08a46d02e and want to thank you for this. I want to know if there is any video tutorial for this?
Big thanks to those who have updated the script over time!
@rahulxdd I don't currently have any video tutorial unfortunately.
@pshah123 please could you take a look at your linkedin and give me a time when we can have a small convo? I have some queries. Please?
Not working !! I have run script but history not showing in contribution bar but i can see all code updated by old dates.Why is happening.
Please help
Obviously this is just a joke, but I'd be terrified to run a script that creates so many files and nested directories unnecessarily. If all you care about is the commit history visible from your profile, you can achieve the same effect without creating any files or directories. The only thing that matters is the number of commits each day (relative to the amount you normally make). For example:
#!/usr/bin/bash
START_Y=1999
END_Y=$(date +%Y)
for Y in $(eval "echo {$START_Y..$END_Y}"); do
for M in {01..12}; do
for D in {01..31}; do
for i in {01..12}; do
GIT_AUTHOR_DATE="$Y-$M-$D $i:00:00" GIT_COMMITTER_DATE="$Y-$M-$D $i:00:00" git commit --allow-empty -m "$i on $M $D $Y"
done
done
done
done
git push origin master
Obviously this is just a joke, but I'd be terrified to run a script that creates so many files and nested directories unnecessarily. If all you care about is the commit history visible from your profile, you can achieve the same effect without creating any files or directories. The only thing that matters is the number of commits each day (relative to the amount you normally make). For example:
#!/usr/bin/bash START_Y=1999 END_Y=$(date +%Y) for Y in $(eval "echo {$START_Y..$END_Y}"); do for M in {01..12}; do for D in {01..31}; do for i in {01..12}; do GIT_AUTHOR_DATE="$Y-$M-$D $i:00:00" GIT_COMMITTER_DATE="$Y-$M-$D $i:00:00" git commit --allow-empty -m "$i on $M $D $Y" done done done done git push origin master
But does this script makes a commit everyday without running it more than once?
@rahulxdd Yes. It makes 12 commits per day for however many years it is configured, same as the original script.
@rahulxdd Yes. It makes 12 commits per day for however many years it is configured, same as the original script.
brbsix I have just sent an email to you, I'd really appreciate it if you could please take a look and reply. You gave me two github resources where I could find a better way to do what I was trying to do with this script.
I am sorry to bother you again @brbsix. Could you please resend the email which you sent last week in response to my query? I accidently deleted it after reading it and now can't find in trash. Please
By the way, I love this script. Excellent work!
Also, it should be noted that many people are going to have issues with their commits being seen by GitHub if their email isn't configured properly for GitHub. I know this, because it happened to me.
I found that manually adding this line (with email replaced with my own) to line 1 fixed the issue.
git config --global user.email "[email protected]"
Also, that only seems to work if I move
git push origin master
to line 21.Just thought I'd mention it!