git-handler
I created git-handler
mostly because I am using webpack to bundle an
electron application, and I needed some way to pull down a template structure that is being hosted on
github. I tried a lot of the other git modules available, and though they are good they weren't compatible
with webpack
. Hence, the only (that I know of) git module that works with webpack
.
Usage
Some new features have been added for version 2 including the ability to do git add
, git checkout
, git clone
,
git commit
, git pull
and git push
. Again, if you have any ideas or issues please post them to the git repository
located here.
; // If using ES6 import statement.const Git = ; // If using ES Vanilla. const RepoUrl = 'https://github.com/user/repo.git';const LocalUrl = '/path/to/local/repository/'; /** * @method add * * Called to add changed items to the local repository so they are ready to be staged. * * @param Path to the local git repository. * @param Callback method for when the process completes.**/Git; /** * @method checkout * * Called to checkout a new or existing branch. * * @param Path to the local git repository. * @param Name of the existing or new branch. * @param True to force creation of new branch if doesn't exist, false to throw an error. * @param Callback method for when the process completes.**/Git; /** * @method clone * * Called to clone a repository. * * @param HTTPS path to the remote repository. * @param Path to where on your machine you would like to clone the repository. * @param (optional) array of flags to use with the clone command. * @param Callback method for when the process completes.**/Git; /** * @method commit * * Called to commit unstaged changes to the local repository. * * @param Path to the local git repository. * @param Message to commit with. * @param Callback method for when the process completes. * * NOTE: Commit automatically calls the 'add' method!**/Git; /** * @method pull * * Called to pull the latest from the remote repository. * * @param Path to the local git repository. * @param HTTPS path to the remote repository. * @param Name of the branch to pull. * @param Callback method for when the process completes.**/Git; /** * @method push * * Called to push the staged changes from your local repository to the remote repository. * * @param Path to the local git repository. * @param HTTPS path to the remote repository. * @param Name of the branch to push to. * @param Credentials object containing { password, userName } * @param Callback method for when the process completes.**/Git;