Nodegit Remote Push with --force

I am using the only github repository for CI to work. My app gets a zip file, I create a repository locally, push my files to the master, add the remote source and then try to push to github.

Since the files already exist in the github registry, I get the error: "[Error: Cannot push because the link you are trying to update on the remote machine contains commits that are missing locally.]"

Does nodegit support pushing the remote with the -force flag to overwrite everything? I have looked through the docs and cannot find them.

Thank! Jeff

+3


source to share


1 answer


NodeGit supports passing refspec to the remote. So you can do a power push for mastering by adding a +

refspec to the front.



Example: remote.push('+refs/heads/master:remotes/origin/master', null, mySignature, myMessage)

+3


source







All Articles