git-repo-is-up-to-date

1.1.0 • Public • Published

git-repo-is-up-to-date

Check if a git repo exactly matches what is in the remote branch

Installation

To use the CLI, install the package globally:

yarn global add git-repo-is-up-to-date

CLI Usage

git-repo-is-up-to-date [directory]

API Usage

const gitRepoIsUpToDate = require('git-repo-is-up-to-date')
 
async function main () {
  const result = await gitRepoIsUpToDate()
  if (result.isUpToDate) {
    console.log('Is up to date!')
  } else {
    console.error('Is not up to date.')
  }
}
 
main()

API

Table of Contents

gitRepoIsUpToDateReturnObject

lib/index.js:28-91

The return object of the gitRepoIsUpToDate function.

Type: Object

Properties

  • baseCommit string The commit hash of the merge base commit
  • errors Array<string> A list of all errors that occured if there are any
  • isUpToDate boolean true if the repo is up to date
  • localCommit string The commit hash of the local commit
  • remoteCommit string The commit hash of the remote commit
  • remoteUrl string The url for the remote repository
  • repoInfo Object The output of the git-repo-info package

gitRepoIsUpToDate

lib/index.js:28-91

Return a promise with the result of checking if a given folder is a git repository where the contents exactly match what is in the remote branch of the repository.

Parameters

  • folder string A path to a file or directory (optional, default process.cwd())

Returns Promise<gitRepoIsUpToDateReturnObject>

Dependents (1)

Package Sidebar

Install

npm i git-repo-is-up-to-date

Weekly Downloads

78

Version

1.1.0

License

MIT

Unpacked Size

10.3 kB

Total Files

6

Last publish

Collaborators

  • evansiroky