【发布时间】:2014-08-01 05:48:25
【问题描述】:
只是想知道是否可以使用 Rugged 创建一个新的 GIT 标签。如果是这样,一个例子将不胜感激。
我基本上只是想在提交 oid 上创建/移动/删除标签。
【问题讨论】:
只是想知道是否可以使用 Rugged 创建一个新的 GIT 标签。如果是这样,一个例子将不胜感激。
我基本上只是想在提交 oid 上创建/移动/删除标签。
【问题讨论】:
你可以在test/tag_test.rb看到一些例子:
@repo = sandbox_init("testrepo.git")
@tag = @repo.tags.create('annotated_tag', "5b5b025afb0b4c913b4c338a42934a3863bf3644", {
:message => "test tag message\n",
:tagger => { :name => 'Scott', :email => 'schacon@gmail.com', :time => Time.now }
})
tag = @repo.tags["test"]
@repo.references.delete(tag)
refute @repo.references.exists?("refs/tags/test")
OP Chris Portman 指出in the comments:
创建/删除方法实际上是
TagCollectionclass 的一部分。
与分支和BranchCollectionclass 相同。
【讨论】: