A nodegit(libgit2) wrapper for controlling freekite's data versions.
npm install --save git+http://zhangzeming@git.sankuai.com/scm/~zhangzeming/freekite-version-control.git
const History = require('freekite-version-control');
const path = require('path');
// Create a new History instance at repoPath.
const repoPath = '';
const history = new History(path.resolve(repoPath));
// Make some changes in the repo.
// Create a commit of these changes.
history.pushAll();
-
dir
<String> Directory path where to store versioned data.
The History
instance relates to a git repository. If the directory specified by dir
is already a git repo, it is used. Otherwise, a new git repo will be created at dir
.
This method will add all changing files to staging area and create a commit to current branch.
-
filepath
<String> The path is relative to repo's root directory.