简体   繁体   English

为什么当我在 Tig 中查看某些 git 提交时会出现“引用”?

[英]Why do some git commits have "refs" when I look at them in Tig?

If I run "tig" on a git repo, I see that some commits have "refs" but some don't.如果我在 git repo 上运行“tig”,我会看到一些提交有“refs”,但有些没有。 The occurrence of "refs" seems random. “refs”的出现似乎是随机的。 I can not find a pattern.我找不到模式。 Sometimes merge commits have them, but sometimes they don't.有时合并提交有它们,但有时它们没有。 Sometimes regular commits have them, but sometimes they don't.有时定期提交有它们,但有时它们没有。

So here is a merge that does not have "refs":所以这是一个没有“refs”的合并:

  commit 632647ebce1bf9c3f125635706a4d0ea34930837
  Merge: c98c7c3 399d871
  Author:     Tommmy
  AuthorDate: Tue Mar 8 17:01:34 2016 -0500
  Commit:     Tommy
  CommitDate: Tue Mar 8 17:01:34 2016 -0500

Here is a merge commit with "refs":这是一个带有“refs”的合并提交:

  commit 2f5d7ba2e6da74e612702267fecd5c55a3709bd2
  Refs: {origin/fogbugz-2159}
  Merge: 0294a42 4a4e27d
  Author:     Tommy
  AuthorDate: Wed Feb 24 10:00:27 2016 -0500
  Commit:     Tommy
  CommitDate: Wed Feb 24 10:00:27 2016 -0500

And likewise, with commits that are not merge commits, some have "refs" and some do not.同样,对于不是合并提交的提交,有些具有“参考”,有些则没有。 What determines which has "refs"?什么决定哪个有“参考”?

The Refs line contains the names of local and remote branches, tags, as well as the output of git describe unless the commit has been tagged. Refs行包含本地和远程分支的名称、标签以及git describe的输出,除非提交已被标记。

Formatting of the refs can be configured via reference-format :可以通过reference-format配置 refs reference-format

  • [] are used for local branches, eg [master] []用于本地分支,例如[master]
  • {} are used for remotes, eg. {}用于遥控器,例如。 {origin/master}
  • <> are used for tags, eg <v1.1.0> <>用于标签,例如<v1.1.0>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM