Skip to content

repo has no method 'branch' #35

Description

@cnzoupeng

var git = require( 'nodegit' );

var repoDir = "/work/gitroot/cpptestprj/.git";

git.repo(repoDir, function( err, repo )
{
if( err ) { throw err; }

  repo.branch( 'master', function( err, branch ) 
  {
    if( err ) { throw err; 
  }

branch.tree().walk().on('entry', function( idx, entry ) 
{
  console.log( entry.name, entry.attributes );
});

});
});

//----------------------------

zoupeng@ubuntu:/work/www$ node gittest.js

/work/gitroot/sourcecode/webide/gittest.js:10
repo.branch( 'master', function( err, branch )
^
TypeError: Object # has no method 'branch'
at /work/gitroot/sourcecode/webide/gittest.js:10:9

need for help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions