在一个git reflog中,HEAD @ {0}被称为究竟是什么?

时间:2018-04-04 01:20:13

标签: git

如果我在一个简单的存储库上reflog我的master分支。它可能看起来像这样:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])
{

    if let image = info[UIImagePickerControllerOriginalImage] as? UIImage
    {
         UserDefaults.standard.set(UIImagePNGRepresentation(image), forKey: "avatarImage")
    }
    else
    {
        //Error message
    }
    self.dismiss(animated: true, completion: nil)
}

你究竟打电话给33e8ab2 master@{0}: commit: 3rd commit e054213 master@{1}: commit: 2nd commit d57537e master@{2}: commit: 1st commit bbc0c23 master@{3}: commit: initial commit

我最初的意思是它是一个参考。但引用指向特定的提交。它是相对参考,也就是说,相对于分支尖端的动作数量?

我的问题:

对于像master@{n}master@{n}HEAD@{n}这样的内容,最具语义性的术语是什么?

以上三种都是相同类型的东西吗?

2 个答案:

答案 0 :(得分:2)

git reflog --help

的含义
  

Reflog在各种Git命令中很有用,用于指定旧值   参考。

例如:

  HEAD@{2} means "where HEAD used to be two moves ago", 

  master@{one.week.ago} means "where master used to point to one
  week ago in this local repository",

答案 1 :(得分:2)

它是gitrevisions之一。具体而言,<ref>@{n} specifies the n-th prior value of that ref

相关问题