Questions tagged [nodegit]

nodegit is a collection of non-blocking Node.js libgit2 bindings, raw api, convenience api, unit tests, documentation and accomodations to make contributing easier.

NodeGit is a collection of non-blocking Node.js libgit2 bindings, raw api, convenience api, unit tests, documentation and accomodations to make contributing easier.

Official Website

API Documentation

110 questions
1
vote
1 answer

git-clone a bare repo with nodegit

Hi, I am cloning a worktree as a bare repo in nodegit Git.Clone('/work/localrepo', '/git/newbare', {bare: 1}) This creates a bare repo just like # in /git/newbare > git clone --bare /work/localrepo Note: newbare has refs to all localrepo branches…
Shane Mendez
  • 160
  • 9
1
vote
0 answers

How to use nodegit within an Electron environment

I'm getting a hard time using nodegit in an Angular 9 application running in an electron environment. It's not an installation problem nor a compilation problem because I can get it to work in some way... When I execute all calls of nodegit in the…
vIceBerg
  • 4,197
  • 5
  • 40
  • 53
1
vote
0 answers

How to detect git repository divergence with nodegit

Having fetched commits from origin/master with nodegit, is there any way to detect that the local repository has diverged from the origin? Basically I'm after a way to do the equivalent of the command line... $ git status On branch master Your…
Rob Agar
  • 12,337
  • 5
  • 48
  • 63
1
vote
0 answers

Create local push to remote using nodegit

So I'm trying to do the following programmatically using the nodegit library: Checkout hotfix branch Get head commmit from hotfix branch Create a topic branch whose head is pointed to hotfix branch head Set upstream topic branch to remote Cherry…
Codepunk
  • 11
  • 2
1
vote
2 answers

How to use credentials to work with nodegit.push on Windows

Edit: I'm changing the question to suit my current understanding of the problem which has changed significantly. Original Title: Nodegit seems to be asking for wrong credentials on push When trying to push using nodegit nothing seems to work on…
Motti
  • 110,860
  • 49
  • 189
  • 262
1
vote
0 answers

How to push a generated file from a node app to github repo?

There will be a file created on some user action in node app. When the file is created , it should be pushed to a github repository to a specific branch. I have tried using simple-git but not able to achieve it. This is for a node app in which a…
1
vote
0 answers

Using nodegit in Electron app throws "Symbol not found:" errors

I build a project in electron and, when I done I want to add git support to app. I try add this, by adding NodeGit to my project. Simple npm install nodegit And create file git.js with only var NodeGit = require("nodegit"); I run script by…
JamesVoo
  • 145
  • 1
  • 11
1
vote
3 answers

A dynamic link library (DLL) initialization routine failed in electron with nodegit

When I use nodegit in electron, I got the error when I start the app: App threw an error during load Error: A dynamic link library (DLL) initialization routine failed. \?\D:\Electron\hello\node_modules\nodegit\build\Release\nodegit.node at…
Terry Chen
  • 369
  • 3
  • 16
1
vote
0 answers

nodegit checkout and switch (remote) branches

When I clone a repository with git (terminal) and then do a checkout to the remote develop branch with nodegit it works just fine. But I ran into the problem, that when I want to switch back to the remote master branch, with the provided example, I…
1
vote
0 answers

node.js rerun script on specific event

I'm not looking for a file watcher like nodemon I have the following scenario: I'm running a script script.js in nodeJS, In some cases I have to switch to a different git branch (I know how to do this part). After the git branch is switched, I would…
Ron Harlev
  • 16,227
  • 24
  • 89
  • 132
1
vote
1 answer

Get diff between two tags with nodegit

How do I get the diff between two tags using nodegit? On the command line, I can see the diff between two tags, no problemo. Additionally, I can use nodegit to list the tags in my repo: const Git = require('nodegit') const path =…
SeanPlusPlus
  • 8,663
  • 18
  • 59
  • 84
1
vote
1 answer

How to get current branch name with nodegit?

I need to know which branch is currently checked out. One solution I see is to list branches and check which one '===' current 'HEAD'. Is there another way ?
Anna B
  • 5,997
  • 5
  • 40
  • 52
1
vote
1 answer

Get latest release using nodegit

How can I get the code from latest release of a Github repository using nodegit? I went through this API guide. I also look around in nodegit user guides. There are examples to get the latest commit - but not the latest release. Note: I would like…
user1700184
  • 1,611
  • 2
  • 16
  • 23
1
vote
0 answers

Is there a way to set git configurations with nodegit?

Getting git configurations was answered in this post Reading Git config variable using NodeGit but is there a way to set git configurations using nodegit?
Ethan Davis
  • 1,209
  • 1
  • 14
  • 21
1
vote
1 answer

Nodegit https auth

Im trying to implement nodegit to do repo control with gitlab, however I need to use basic username password authentication and the documentation only uses ssh. I've tried to use Cred.userpassPlaintextNew but i get [Error: Too many redirects or…
Jimmy Hodgson
  • 183
  • 11