-
Notifications
You must be signed in to change notification settings - Fork 889
git tag
Kunlin Yu edited this page Nov 10, 2022
·
8 revisions
$ git tag
using (var repo = new Repository("path/to/your/repo"))
{
foreach (Tag t in repo.Tags)
{
Console.WriteLine(t.FriendlyName);
}
}
$ git tag -n -l myTag
using (var repo = new Repository("path/to/your/repo"))
{
Tag t = repo.Tags["your-tag-name"];
Console.WriteLine(t.IsAnnotated ? t.Annotation.Message : ((Commit) t.Target).MessageShort);
}
$ git tag a-nice-tag-name
using (var repo = new Repository("path/to/your/repo"))
{
Tag t = repo.ApplyTag("a-nice-tag-name");
}
$ git tag a-better-tag-name refs/heads/cool-branch
$ git tag the-best-tag-name 5df3e2b3ca5ebe8123927a81d682993ad597a584
using (var repo = new Repository("path/to/your/repo"))
{
Tag t = repo.ApplyTag("a-better-tag-name", "refs/heads/cool-branch");
Tag t2 = repo.ApplyTag("the-best-tag-name", "5df3e2b3ca5ebe8123927a81d682993ad597a584");
}
$ git tag -a a-good-tag-name 5df3e2b -m "Create a tag pointing at 5df3e2b"
using (var repo = new Repository("path/to/your/repo"))
{
Signature tagger = new Signature("James", "@jugglingnutcase", DateTime.Now);
repo.ApplyTag("a-good-tag-name", "5df3e2b", tagger, "Create a tag pointing at 5df3e2b");
}
To be done
To be done