Skip to content

Set committer date so older years appear on GitHub - #66

Open
muhdbasiirzulkifle wants to merge 1 commit into
artiebits:masterfrom
muhdbasiirzulkifle:fix/set-committer-date
Open

Set committer date so older years appear on GitHub#66
muhdbasiirzulkifle wants to merge 1 commit into
artiebits:masterfrom
muhdbasiirzulkifle:fix/set-committer-date

Conversation

@muhdbasiirzulkifle

Copy link
Copy Markdown

Summary

  • GitHub contribution graphs use committer date, not author date. git commit --date only sets the author date, so generated history from past years was attributed to today.
  • Set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE when creating commits so older years (e.g. 2022-2025) show up on the profile.
  • Document this in the README, including a git filter-branch rewrite for people who already generated history.

Test plan

  • Run npx fake-git-history --startDate "2022/01/01" (or node src/cli.js locally).
  • In the generated my-history repo, confirm author and committer years match:
    git log --format='%ad %cd' --date=format:'%Y' | awk '{print $1, $2}' | sort | uniq -c
    
  • Push to a GitHub repo and check older years on the profile (year list on the left), not only the last 12 months.

GitHub contribution graphs use committer date, not author date.
`git commit --date` only sets the author date, so generated history
from past years was attributed to today.

Also document the behavior and a rewrite for existing repos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant