English 中文(简体)
如何同时利用电梯重新定位机/发射机和时装机?
原标题:How to use git rebase to edit both author/committer and timestamps at the same time?
  • 时间:2023-08-04 20:29:10
  •  标签:
  • git
  • rebase

我曾试图重写一个吉特存放处的历史,以巩固承诺,删除大量档案和许多其他变化。 <代码>git 过滤-branch不建议将其作为一种工具,我希望能够准确手工地重写历史。

我已陷入一个重大障碍。 当我重写承诺时,改写的承诺表明,我(作者和我承诺)所为,我不想这样做。

我可以通过运行<代码>git configuser. : 姓名和git configuser.email,然后在重新计算每项承诺。 因此,它像原作者所承诺的那样。

So far so good, but when I do this the committer timestamp is invariably "now". I can change the author timestamp with git commit --amend --date, but the committer timestamp is unchangeable.

我可以使用以下选择:-committer-date-is-author-date,而且该办法行之有效(尽管它改变了时间区,我不喜欢这样做)。 自动检索基数不允许我使用<代码>git configuser.name/email,使承诺的原始作者自己展示。

I have tried using set GIT_COMMITTER_DATE= followed by git commit --amend --no-edit. It was working at first, but then suddenly stopped working for an unknown reason. It simply does nothing now - the committer timestamp isn t affected.

This leaves me with a choice of having me added to the commits as the committer, or having an inaccurate timestamp of "now" in a project with years of history.

I m looking for a way so that people looking at the history can see the original author and the original timestamp (or whatever ones I specify), and that is compatible with interactive rebase because I m going to be doing a lot of rebasing, so the entire history will be rewritten from further and further in the past.

Yeah, this might be a crazy project, but does anyone have any suggestions on how to accomplish this?

(Yes, I am doing this on a separate branch. I will force push to the main branch after I have finished the project.)

EDIT:当我试图将环境变量确定为后基的一部分时,情况就是如此:

(Using the following submissions: https://gyazo.com/8a38c243dac215c4a3394ef8fae78e)

我可以利用环境指标确定环境变量,但Gite可以这样做:gyazo.com/39644a586b78cb933988e90880c67286

I am using Windows 10 Home Edition.

问题回答

根据。 文件

GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE

Their values take precedence over the configuration values.

So in your case you need to set the GIT_COMMITTER_* variables.

可以通过使用指挥系统对变数进行核实。

git var GIT_COMMITTER_IDENT

如果不承认他们,确保你实际上确定他们。 设定和阅读环境变量是本组织所依赖的,可以trick。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签