bash - Git (GitHub) 在过去的日期提交

标签 bash git github commit

我正在开发一个 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/

相关文章:

bash - 引号转义——来自 bash 的 rsync

linux - 在查找和移动 Bash 脚本中包含具有相同名称的不同文件

linux - 将本地 git 配置复制到 docker 容器中

git - 添加包含另一个子模块的 git 子模块?

Github:推送 pull 请求

git - 如何做 git sub modules 以及为什么要使用 git sub module

bash - 从 Bash 脚本中的变量调用带空格的命令行

bash - xdotool 如何做水平滚动?

git svn clone 格式错误的索引信息错误

git - 重新设置特定的 SHA1