Skip to content

youngBrain1893/simple-repo-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motivation

A easy way for cli/utils to operate with git.

Use simple-git ability and add some frequently used API(eg:branchExistsgetCurrentBranchName

Usage

yarn add simple-repo-kit
import SimpleRepoKit from 'simple-repo-kit';

const repo = new SimpleRepoKit();
await repo.initialize(__dirname);

const delegatedRepo = repo.delegate(['diff', 'log']); // https://www.npmjs.com/package/simple-git#API

delegatedRepo.getCurrentBranchName();
delegatedRepo.branchExists('some branch');
delegatedRepo.checkout('main');
delegatedRepo.commitLocalChange('commit message');

APIs

  • getCurrentBranchName()

  • branchExists(branchName: string, branchType: BranchType)

  • stashBeforeOperate()

  • checkout(branchName: string, sourceBranch: string)

  • getLastLog()

  • commitLocalChange(message: string)

  • delegate(methods: Array)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published