我正在开发一个 git 项目(托管在 GitHub 上)并使用 GitHub for Windows。昨天,我完成了很多工作,但 Windows 版 GitHub 拒绝了我(说它无法提交),我无法提交。
我不想失去我的 GitHub 提交记录,所以我想知道是否有任何方法可以在过去的日期提交并与我的 GitHub 同步(如果可能的话)。
另外:我已经在 git-bash 中暂存了我的提交,但还没有提交。
最佳答案
虽然问题“How do I make a Git commit in the past?”解释了如何修改提交作者日期:
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.
OP 要求:
That question does not specify the GitHub result... would it work in the same way?
是的:存在多个项目,允许您生成和推送“过去完成的”提交,以更新您的贡献图表。
例如参见 contribution.io , github-contribution , 或 gitgardener .
您需要做的就是将这些修改后的提交推送到 GitHub 存储库的 master
分支,如 I mention here .
关于bash - Git (GitHub) 在过去的日期提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23609991/