DEV Community

Discussion on: How I got Linus Torvalds in my contributors on GitHub

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

I think GitHub should fix this bug to prevent attacks on profiles

This is neither a bug, nor is it easy to "fix". The solution is to use the right tool for the job and sign your commits.


Oh and by the way: git commit --author 'Your Name <your.name@domain.com>' does the same thing but is much easier to remember. And it's far from the only thing you can mess with, take for example this neat little script I use to make commits "in the future":

#!/bin/sh
DATE="$1"; shift 1
export GIT_AUTHOR_DATE=$(date +%s -d "$DATE")
export GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
git "$@"
Enter fullscreen mode Exit fullscreen mode

Just put that script in your path as git-timeshift and you can call it as git timeshift "+3 hours" commit to commit something with a timestamp 3 hours in the future. Why you might want to do this, I'll leave to your imagination.

Collapse
 
martiliones profile image
martiliones • Edited

Thank you for your comment!

You can also make commit in the past. There is Anthony Fu's script to make commit in 1990 github.com/antfu/1990-script