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
0
votes
0 answers

Is there a way to perform git archive with nodegit api?

I want to perform a git archive using node-git. A feature of git-archive is that it excludes from archive the patterns set with export-ignore inside .gitattributes. What would be a simple way to perform a git-archive operation using nodegit api?
Marinos An
  • 9,481
  • 6
  • 63
  • 96
0
votes
3 answers

nodegit - How to know if a commit is empty (to avoid pushing empty commits)

I'm using nodegit and I can't figure out how to detect whether the there has been changes to commit. Currently, I'm committing when an external event happens, but I don't know if this will cause a real difference in the files. I don't check whether…
Vadorequest
  • 16,593
  • 24
  • 118
  • 215
0
votes
0 answers

Nodegit: is there a way to check if remote repository exist tor not

Can we check if the passed repository (e.g.) exists on the git server or not (without cloning) in Nodegit? So I have a use-case where I just need to check if the connection to that git repository can be established or not. because I don't know which…
0
votes
1 answer

How to change Jest module version for node.js 14?

I just started using JEST, I can't figure out what's wrong. I've tried reinstalling all packages and clearing the cache. ● Test suite failed to run The module '/Users/dan_kos/Documents/Work/Authorization…
Daniel
  • 11
  • 3
0
votes
1 answer

Errors installing nodegit in linux

I entered npm install nodegit and got the following error npm ERR! Linux 3.10.0-514.2.2.el7.x86_64 npm ERR! argv "/usr/bin/node" "/bin/npm" "install" "nodegit" npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! path…
0
votes
1 answer

Clone repo with submodules using nodegit

What is the equivalent way of executing git clone --recurse-submodules git@myrepo.git with NodeGit? I've found some manual examples of how to do it but they're quite old and I'm hoping there's a native way to do it now.
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
0
votes
1 answer

NodeGit checkout a branch but Get error "HEAD detached at origin/branch"?

I am using nodegit to checkout from clone and Open it to do something. My code like this: //repo is a Repository from Clone() or Open() //branchName is your branch name, of course repo.getBranch('refs/remotes/origin/' + branchName) …
cauchuyennhocuatoi
  • 461
  • 3
  • 8
  • 21
0
votes
1 answer

(nodegit) How to read/write from/to private Github repo using a token

I copied some code from the net and got it working to clone and push to one of my own repos on github. Using the same code I tried to do the same with a repo now owned by me but by an organisation that I am part of and that I have write access to.…
caefer
  • 63
  • 4
0
votes
1 answer

How can I list all files with NodeGit? (Equivalent of 'git ls-files')

I currently run the following git command for list of all untracked and modified files: git ls-files -mo --exclude-standard Is there any equivalent for it in the NodeGit world?
nitishagar
  • 9,038
  • 3
  • 28
  • 40
0
votes
0 answers

How to connect to git repo and create branch using nodegit?

I am trying to connect to my git repo through code wanted to create branch dynamically , using nodegit to achieve this task it is throwing an error No file or directory found. Need help with following task with nodegit : 1- Connect to git repo by…
hussain
  • 6,587
  • 18
  • 79
  • 152
0
votes
1 answer

Runing nodegit in Electron fails

I installed nodegit 0.26.5 via npm and import the package in the renderer part of my Electron application. During compilation I receive this error below: WARNING in ./node_modules/nodegit/dist/nodegit.js Module not found: Error: Can't resolve…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
0
votes
0 answers

NodeGit fileHistoryWalk doesn't show merge commit

I found that when I used 'fileHistoryWalk' for a file. The result showed the last commit is red one rather then blue one. also the merge commit between red and blue didn't show, either. How can I really know the all commit about a file including…
Bear
  • 51
  • 1
  • 6
0
votes
2 answers

nodegit reset/revert single file

I'm trying to reproduce the checkout file operation using nodegit for reverting current changes of a file. git checkout -- filename.ext My first attempt was to use checkoutRef function from Repository object, like…
Okura
  • 123
  • 8
0
votes
1 answer

How can I get commit message on file using nodegit?

Currently, I am listing the files on git tree using: repository .getBranchCommit(treeRefName) .then((commit)=> commit.getTree()) .then((tree) => { obj.repositoryTree = tree; obj.repositoryTreeEntries = tree.entries(); …
georoot
  • 3,557
  • 1
  • 30
  • 59
0
votes
1 answer

Git blame a file from an earlier commit with NodeGit

Is it possible to use the git blame command to get the annotations from each line in an earlier revision of a file with NodeGit? There is an method called Blame.file(repo, path, [options]), but it isn't clear to me exactly what all the properties of…
micnil
  • 4,705
  • 2
  • 28
  • 39