git-repo-is-up-to-date
v1.1.0
Published
Check if your git repo exactly matches what is in the remote branch
Downloads
349
Readme
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
The return object of the gitRepoIsUpToDate function.
Type: Object
Properties
baseCommit
string The commit hash of the merge base commiterrors
Array<string> A list of all errors that occured if there are anyisUpToDate
boolean true if the repo is up to datelocalCommit
string The commit hash of the local commitremoteCommit
string The commit hash of the remote commitremoteUrl
string The url for the remote repositoryrepoInfo
Object The output of thegit-repo-info
package
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
folder
string A path to a file or directory (optional, defaultprocess.cwd()
)
Returns Promise<gitRepoIsUpToDateReturnObject>