【问题标题】:git: get the note using the commit id of the notegit:使用注释的提交 id 获取注释
【发布时间】:2013-08-19 17:25:00
【问题描述】:

这听起来像是一个愚蠢的问题:P。 据说,我在一个特定的提交中添加了一个注释,比如 commitno

git notes add -m "Sample Note" $commitno
git push origin refs/master/*

它在内部生成一个注释的提交(例如,commitID)。 如何使用笔记的 commitID 获取笔记?

【问题讨论】:

  • 我建议你阅读这篇文章:stackoverflow.com/questions/18273879/…。它对 git 中的注释有很大的解释。而且它只有两天大
  • 我不知道您所说的“内部为注释生成提交(例如,commitID)”是什么意思,但是如果您指的是推送到的遥控器,请向 添加注释它的 refs/notes/commits 伪分支,你必须fetch 得到的引用才能找到远程添加的提交。

标签: git


【解决方案1】:
$ git branch -v
* master 6ff9387 Initial commit

$ git notes add -m "sample note" 6ff9387

$ git notes
7a902ca6d69fbd2c440ac0a714380cfd8a387262 6ff9387eeab6449cdc2948e47882725722b1145f

$ git cat-file -p 7a902ca6d69fbd2c440ac0a714380cfd8a387262
sample note

【讨论】:

  • 但是在这里,您正在寻找文件的内容,该文件的名称是在另一个分支中提交的提交 ID。我想使用它自己的提交 ID 获取注释。
猜你喜欢
  • 2013-08-18
  • 2019-01-21
  • 2016-08-24
  • 2012-11-24
  • 1970-01-01
  • 1970-01-01
  • 2013-06-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多