Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I push newly the created Tag? #72

Closed
HejVkt opened this issue May 21, 2020 · 1 comment
Closed

How do I push newly the created Tag? #72

HejVkt opened this issue May 21, 2020 · 1 comment

Comments

@HejVkt
Copy link

HejVkt commented May 21, 2020

Please help. I have the same problem like this.
src-d/go-git#430 (comment)

After creating new tag it's appears on my local storage, but how I can push it to the remote repo?

repo.Push(&git.PushOptions{RemoteName:"origin"}) pushes my commits, but not the Tag

@HejVkt HejVkt changed the title But how do I push newly the created Tag? How do I push newly the created Tag? May 21, 2020
@HejVkt
Copy link
Author

HejVkt commented May 21, 2020

I figured it out.
Аfter a new tag has been created you should push it to remote with specifiec ref, something like this:

	err = r.Push(&git.PushOptions{
		RemoteName: "origin",
		RefSpecs: []config.RefSpec{
			config.RefSpec("+refs/tags/" + newTagName +":refs/tags/" + newTagName),
		},
	})

@HejVkt HejVkt closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant