문제

견고한 새 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 }
})
.

삭제의 경우 test/reference_test.rb :

tag = @repo.tags["test"]

@repo.references.delete(tag)
refute @repo.references.exists?("refs/tags/test")
.


the op chris portman 지적 comments in that :

create / delete 메소드는 실제로 TagCollection 수업 .

가지와 BranchCollection 클래스 .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top