Im trying to fetch the tags from a remote with git2go(https://github.com/libgit2/git2go). When i'm cloning the repository I can list all the tags with the following code:
iter, err := repository.NewReferenceIterator()
ref, err := iter.Next()
for err == nil {
if ref.IsTag() {
fmt.Println(ref.Name())
}
ref, err = iter.Next()
}
But when I fetch the code from the remote it does not update the tags. Im fetching new code from the repository with:
remote, err := p.repository.LoadRemote("origin")
remote.Fetch([]string{}, nil, "")
This is my config:
[core]
bare = false
repositoryformatversion = 0
filemode = true
logallrefupdates = true
[remote "origin"]
url = file:///home/testrepo
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
I've added(Can I specify in .git/config to fetch multiple refspecs?):
fetch = refs/tags/*:refs/tags/*
But that does not do anything.
I also added the tags in the refspec but that gave the error: ref 'refs/remotes/origin/master' doesn't match the destination