Git (GitHub) commit at past date

后端 未结 2 459
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 04:54

I am working on a git project (hosted on GitHub) and using GitHub for Windows. Yesterday, I got a lot accomplished but GitHub for Windows bailed on me (says it cannot make a com

相关标签:
2条回答
  • 2021-01-30 05:16

    While the question "How do I make a Git commit in the past?" explains how to amend the commit author date:

    git commit --amend --no-edit --date="Fri Nov 6 20:00:00 2015 -0600" 
    

    Run that after a commit to amend the last commit with the timestamp noted.
    The --no-edit will leave the message as-is.

    The OP asks:

    That question does not specify the GitHub result... would it work in the same way?

    Yes: multiple projects exist allowing you to generate and push commits "done in the past", in order to update your contribution chart.

    See for instance contribution.io, github-contribution, or gitgardener.

    All you need to do, is to push those amended commit on the master branch of your GitHub repo, as I mention here.

    0 讨论(0)
  • 2021-01-30 05:18
    git commit --allow-empty --date="Sat Nov 14 14:00 2015 +0100" -m '2 Dec commit'
    

    It will create empty commit with provided date

    0 讨论(0)
提交回复
热议问题