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
4
votes
1 answer

Nodegit create remote repository and make first push

Many people claim to have solved this problem in the following examples https://github.com/nodegit/nodegit/issues/463 Nodegit: How to modify a file and push the changes? However after testing these solutions out I'm given an error that claims the…
Ethan Davis
  • 1,209
  • 1
  • 14
  • 21
4
votes
2 answers

NodeGit - resolve merge conflict in favor of "theirs"

In git we can use following command to achieve it: git merge branch_name --strategy-option theirs But I couldn't figure out a way in nodegit: http://www.nodegit.org/api/repository/#mergeBranches repo.mergeBranches("master.min", "master", null,…
adnan kamili
  • 8,967
  • 7
  • 65
  • 125
4
votes
1 answer

Trouble opening repository with NodeGit

I'm trying to use nodegit to open up a git repository with the following code: var git = require('nodegit'); git.Repo(repoPath, function(error, repository) { if (error) throw error; } This gives me the following error, no matter what I assign…
Vegar
  • 12,828
  • 16
  • 85
  • 151
3
votes
1 answer

How to get a status progress when cloning a repo via nodegit?

I use Clone.clone from nodegit and I am looking for a progress status callback. The function has a CheckoutOptions object, which I call like this: var opts: CloneOptions = {}; opts.checkoutOpts = { progressCb: function() { …
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
3
votes
1 answer

Checkout a specific commit with NodeGit

I have a NodeGit repository object, repo, and a string sha code which represents a commit id, commit_id. How can I perform a git checkout of this commit using NodeGit, which would act the same as the command git checkout $commit_id? So far, I have…
Sam
  • 3,070
  • 3
  • 20
  • 26
3
votes
1 answer

Writing a file to a bare repostory not at the root with NodeGit / LibGit2

I've been able to write a file to a branch in a bare repository using the below code, but it only works for files in the root. I haven't been able to find a good example in the documentation of how to build a tree for a subfolder and use that as a…
rjmunro
  • 27,203
  • 20
  • 110
  • 132
3
votes
1 answer

How to get thr branch of a commit with nodegit

I'm trying to know how I can get the branch in which a commit was created in (not the head). I know a branch is just a 'tag' attached to a commit (the head of that branch) For example, in this image, what would I need to do to get the branch of the…
R00t
  • 186
  • 1
  • 2
  • 14
3
votes
2 answers

How do I pull from a branch with nodegit?

Would appreciate some help with nodegit. I got it to checkout a branch (branch-development-modular-alpha-2.0.0) with: var cloneRepo = nodegit .Clone(cloneURL, repoPath, cloneOptions) .then(function (repo) { repo.getBranch('refs/remotes/origin/' +…
Chris F.
  • 493
  • 5
  • 17
3
votes
0 answers

Ignore .gitconfig when cloning repository with NodeGit

I'm trying to use NodeGit to download some tutorials for my application from private repositories. I'm using a token to authenticate and download them via https. The problem is, if user has set [url "git@github.com:"] insteadOf =…
remdezx
  • 2,939
  • 28
  • 49
3
votes
0 answers

NodeGit return blob oids at HEAD

Whats the best way to obtain a list of 'current' blob oids at HEAD? I have the following, but it returns all oids in the repo, including deleted files etc. I'm not interested in 'deleted' blobs. return Repository.openBare( repoPath ) .then( (repo)…
almccann
  • 389
  • 3
  • 13
3
votes
1 answer

Nodegit Remote Push with --force

I'm using a single github repo for CI work. My app receives a zip file, I create a repo locally, commit my files to the master branch, add the origin remote and then try to push to github. Since files already exist in the github repo, I get the…
Jeff Douglas
  • 191
  • 1
  • 7
3
votes
1 answer

Yeoman using NodeGit's Reset, getting constant object error

First time using NodeGit and having issues with the Reset function. I'm trying to reset a folder that has been cloned to the current HEAD of origin/master. Even though i'm giving it a target, it says it's still required: Error: Object target is…
Shane
  • 564
  • 2
  • 9
2
votes
0 answers

"initial ref transaction called with existing refs" error when reconstituting git tags

I am working on a git remote which translates the commits tree to native IPFS data structures on push and reconstructs them on fetch. The process is working for commits, but when I try to recreate a tag the command succeeds, but the clone fails with…
dysbulic
  • 3,005
  • 2
  • 28
  • 48
2
votes
1 answer

Perform a `git clean` in a repository using NodeGit

I have a NodeGit repository, repo. This repository has some local changes, both in tracked and untracked files & directories. How can I clean this repository, with the same effect as the git clean -f -d command, so that afterwards the local changes…
Sam
  • 3,070
  • 3
  • 20
  • 26
2
votes
1 answer

Console.log not showing in second layer of node promise

I'm creating a custom CHANGELOG generator based on git commits using nodegit (I didn't quite like the existing similar projects, and it's a pretty simple tool to make, in theory at least). My problem right now is that I can't seem to get the…
Simon Hyll
  • 3,265
  • 3
  • 24
  • 44