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

编程入门 行业动态 更新时间:2024-10-25 03:16:12
本文介绍了Git的(GitHub上)提交在过去的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我工作的一个Git项目(托管在GitHub上),并使用Gi​​tHub上的Windows。昨天,我得到了很多来完成,但GitHub上的Windows救助对我(说,它无法做出承诺),我无法提交。

我不想失去我的GitHub提交连胜,所以我想知道是否有任何方式在过去的日期和同步与我的GitHub提交(如果可能的话)。

另外:我已经上演我犯混帐bash的,但还没有提交

。解决方案

虽然这个问题:如何使一个Git犯下的?过去解释了如何修改提交笔者日期:

git的承诺--amend --no编辑--date =周五11月6日20:00:00 2015年-0600

  

运行,经过一个提交修改最后一次提交的时间戳指出。结果  在 - 无修改将离开的消息原样

在OP问:

  

这个问题没有指定GitHub的结果......它会以同样的方式工作?

是:存在多个项目,让您生成和推动的提交过去所做的,以更新你的贡献的图表

例如见 contribution.io 或(更准确)的 github上-贡献。

所有你需要做的,是推动这些修改提交的 主 您的GitHub库的分支,为的I何况这里。

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 commit) and I was not able to commit.

I do not want to lose my GitHub commit streak, so I was wondering if there was any way to commit in a past date and sync with my GitHub (if this is possible).

Also: I have staged my commits in the git-bash but have not committed yet.

解决方案

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 or (more accurately) github-contribution.

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

更多推荐

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

本文发布于:2023-11-27 10:19:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637670.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日期   在过去   Git   GitHub

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!