为什么git rebase - 在b,git rebase - b中创建一个与原始不同的SHA1? [英] Why does git rebase --onto a b, git rebase --onto b a create a different SHA1 from the original?

查看:105
本文介绍了为什么git rebase - 在b,git rebase - b中创建一个与原始不同的SHA1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有以下修订图,其中c为当前分支:

Suppose you have the following revision graph, with c as the current branch:

c   a
 \ /
  b

git rebase --onto ab 创建以下内容:

    c
   /
  a
 /
b

git rebase --onto ba 返回图表为:

and git rebase --onto b a returns the graph to:

c   a
 \ /
  b

然而,在两次rebasings之前,c的新SHA1与c的旧SHA1不同。为什么会出现这种情况?

However, the new SHA1 of c is different from the old SHA1 of c, before both rebasings. Why is this the case?

推荐答案

(请注意,最初编写时有一个作者日期 commiter date,当实际的提交被记录下来时,只有后者发生了变化,要自己看看,使用 git log --pretty = fuller ,或者看看在 gitk 中的提交。)

(Note that there's an "author date", when it was originally written, and a "commiter date", when the actual commit was recorded. Only the latter has changed. To see this for yourself, use git log --pretty=fuller, or just look at the commit in gitk.)

这篇关于为什么git rebase - 在b,git rebase - b中创建一个与原始不同的SHA1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆