git-notes用于添加或检查对象注释。如何删除git-notes提交,这样git - not命令的提交将不存在于git历史中。我想删除git-note commit,我不是指“git-note remove",它只是删除注释并进行另一次提交。
发布于 2012-08-06 21:40:53
由于git将笔记存储在一个单独的(孤立的)分支上(默认情况下由refs/notes/commits指向),您可以创建分支,指向笔记头部,像往常一样编辑它(例如,使用rebase ),并更新对该分支顶部的笔记引用:
// create branch pointing to the tip of notes branch
git checkout -B notes-editing refs/notes/commits
// do whatever you want with notes-editing branch
// for example, git reset --hard HEAD^ to remove last commit
// reset notes reference to the tip of temporary branch
git update-ref refs/notes/commits notes-editing
// remove temporary branch
git checkout master
git branch -D notes-editing发布于 2013-08-28 03:24:40
git notes prune删除不存在/无法访问的对象的所有注释。
发布于 2012-08-06 21:25:38
git notes不会创建自己的提交。
它实际上可以用来向现有的提交中添加(git notes add)一些注释。
当您调用git notes remove时,注释将被删除,并且同样不会进行自己的提交。
https://stackoverflow.com/questions/11829078
复制相似问题