git2r icon indicating copy to clipboard operation
git2r copied to clipboard

Push all tags

Open jennybc opened this issue 8 years ago • 5 comments

Does git2r support the equivalent of this: git push origin --tags?

If not, could it?

jennybc avatar Nov 25 '16 20:11 jennybc

For that matter, is it possible to push a tag at all right now? It looks like I can't use a tag as the refspec in the push method for a git_repository.

> tags(repo)
$`fbind-init`
[837e86] fbind-init
> push(repo, "origin", "fbind-init",
+      credentials = cred_user_pass("EMAIL",
+                                         Sys.getenv("GITHUB_PAT")))
Error in .local(object, ...) : 
  Error in 'git2r_push': Not a valid reference 'bind-init'

jennybc avatar Nov 25 '16 21:11 jennybc

Does it work if you try: push(repo, "origin", "refs/tags/*:refs/tags/*") ?

stewid avatar Nov 25 '16 21:11 stewid

I get this:

> push(repo, "origin", "refs/tags/*:refs/tags/*", credentials = cred_user_pass("EMAIL", Sys.getenv("GITHUB_PAT")))
Error in .local(object, ...) : 
  Error in 'git2r_push': Not a valid reference 'refs/tags/*'

jennybc avatar Nov 25 '16 21:11 jennybc

Ooh, this works for pushing a single tag, which is progress:

push(repo, "origin", "refs/tags/fbind-init", credentials = cred_user_pass("EMAIL", Sys.getenv("GITHUB_PAT")))

jennybc avatar Nov 25 '16 21:11 jennybc

Great :+1:

stewid avatar Nov 25 '16 21:11 stewid