1.1.1 • Published 3 years ago

av-git-operation v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

What is this?

Perform the git-operations in nodeJs.

Installation

npm i av-git-operation --save

OR

yarn add av-git-operation

Usage

  • Import the module
const gitOperation = require("av-git-operation");
  • Clone a repo using
gitOperation.clone(
  "YOUR HOST REPO URL",
  "FOLDER PATH WHERE YOU WANT TO PUT REPO",
  { checkout: "Your Branch Name" },
  (err) => {
    if (err) {
      throw err;
    }
    console.log("Cloning Done");
  }
);
  • Config the git user
gitOperation.config(
  "FOLDER PATH WHERE YOU PUT REPO",
  { email: configUserEmail, name: configUserName },
  (err) => {
    if (err) {
      throw err;
    }
    console.log("Config Done");
  }
);
  • Commit the repo
gitOperation.commit(
  "FOLDER PATH WHERE YOU PUT REPO",
  { message: commitMessage },
  (err) => {
    if (err) {
      throw err;
    }
    console.log("Commit Done");
  }
);
  • Push the changes to your repo
gitOperation.push(
  "FOLDER PATH WHERE YOU PUT REPO",
  { branch: "Your Branch Name" },
  (err) => {
    if (err) {
      throw err;
    }
    console.log("Push Done");
  }
);
  • File change status of your repo
gitOperation.status("FOLDER PATH WHERE YOU PUT REPO", (result, err) => {
  if (err) {
    throw err;
  }
  console.log(result);
});

Options

Use debug to print the useful information.

{
  debug: true;
}

❤️ Contributing

This is an open source project, so feel free to contribute. How?

  • Open an issue.
  • Propose your own fixes, suggestions and open a pull request with the changes.

Author

Umesh Verma