How to push a file to past time?

后端 未结 2 1715
夕颜
夕颜 2020-12-17 07:06

Yesterday, I made changes on a project file but forgot to commit and push it on github. I don\'t want that my contribution streak breaks after 51 days..so I would like to pu

2条回答
  •  甜味超标
    2020-12-17 07:22

    Yesterday, I made changes on a project file but forgot to commit and push it on github

    As far as I know, GitHub contribution graphs rely on commit datetimes, not push datetimes. FWIW, there are even tools abusing this to use the contribution graph as a drawing board (cf. this google search).

    So the easy way would be to

    • Commit locally now

    • Then rewrite your latest commit to change the authorship date (pick the time and timezone you'd like) with something like git commit --amend --date="Wed Jul 12 14:17 2014 +0900"

    • Push

提交回复
热议问题