0

I am trying to push the local changes on the master branch to the remote master branch using this library for gradle https://ajoberstar.org/grgit/main/grgit-push.html:

grgit.push(remote:"master",tag:true)

It complains and i get this exception org.eclipse.jgit.errors.NoRemoteRepositoryException master not found how is that possible as master branch does exist at remote.

I even tried the following:

grgit.push(remote:"refs/heads/master",tags:true)
grgit.push(remote:"refs/remotes/origin/master",tags:true)

with no luck and same exception occurred as above.

But when i try with:

grgit.push(branch:all,tags:true)

that works but it pushes to all the branches at remote but that what i don't want. My requirement is to push to the specific branch. Like just master branch only.

1 Answer 1

0

Ok i have achieved this by:

grgit.push(refsOrSpecs: ["refs/heads/master": "refs/heads/master" ],tags:true) 

does the trick push to remote master branch only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.