1.1.0 • Published 6 years ago
git-repo-is-up-to-date v1.1.0
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-dateCLI 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
The return object of the gitRepoIsUpToDate function.
Type: Object
Properties
baseCommitstring The commit hash of the merge base commiterrorsArray<string> A list of all errors that occured if there are anyisUpToDateboolean true if the repo is up to datelocalCommitstring The commit hash of the local commitremoteCommitstring The commit hash of the remote commitremoteUrlstring The url for the remote repositoryrepoInfoObject The output of thegit-repo-infopackage
gitRepoIsUpToDate
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
folderstring A path to a file or directory (optional, defaultprocess.cwd())
Returns Promise<gitRepoIsUpToDateReturnObject>