https://github.com/umeshiscreative/av-git-operation
Perform the git-operations in nodeJs.
https://github.com/umeshiscreative/av-git-operation
git gitcommands javascript nodejs
Last synced: 3 months ago
JSON representation
Perform the git-operations in nodeJs.
- Host: GitHub
- URL: https://github.com/umeshiscreative/av-git-operation
- Owner: umeshiscreative
- Created: 2021-03-18T07:54:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-26T10:06:38.000Z (almost 5 years ago)
- Last Synced: 2025-02-20T20:47:28.509Z (about 1 year ago)
- Topics: git, gitcommands, javascript, nodejs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/av-git-operation
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```javascript
const gitOperation = require("av-git-operation");
```
- Clone a repo using
```javascript
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
```javascript
gitOperation.config(
"FOLDER PATH WHERE YOU PUT REPO",
{ email: configUserEmail, name: configUserName },
(err) => {
if (err) {
throw err;
}
console.log("Config Done");
}
);
```
- Commit the repo
```javascript
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
```javascript
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
```javascript
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.
```javascript
{
debug: true;
}
```
---
## ❤️ Contributing
This is an open source project, so feel free to contribute. How?
- Open an [issue](https://github.com/umeshiscreative/av-git-operation/issues/new).
- Propose your own fixes, suggestions and open a pull request with the changes.
## Author
Umesh Verma