# git-repo-is-up-to-date

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

Latest version **1.1.0** (published 2019-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install git-repo-is-up-to-date
pnpm add git-repo-is-up-to-date
yarn add git-repo-is-up-to-date
bun add git-repo-is-up-to-date
```

Provides the command `git-repo-is-up-to-date`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-10-01 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Evan Siroky |
| Maintainers | evansiroky |
| Keywords | git |

## Links

- npm: https://www.npmjs.com/package/git-repo-is-up-to-date
- Repository: https://github.com/ibi-group/git-repo-is-up-to-date
- Homepage: https://github.com/ibi-group/git-repo-is-up-to-date#readme
- Issues: https://github.com/ibi-group/git-repo-is-up-to-date/issues
- npm.io page: https://npm.io/package/git-repo-is-up-to-date

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^2.0.4
- [git-repo-info](https://npm.io/package/git-repo-info.md) ^2.1.0
- [git-remote-origin-url](https://npm.io/package/git-remote-origin-url.md) ^3.0.0

## Recent versions

- 1.1.0 (latest) — 2019-10-01
- 1.0.1 — 2019-09-17
- 0.0.1-security — 2019-09-17

## 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:

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

## CLI Usage

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

## API Usage

```javascript
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

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [gitRepoIsUpToDateReturnObject](#gitrepoisuptodatereturnobject)
    -   [Properties](#properties)
-   [gitRepoIsUpToDate](#gitrepoisuptodate)
    -   [Parameters](#parameters)

### gitRepoIsUpToDateReturnObject

[lib/index.js:28-91](https://github.com/ibi-group/git-repo-is-up-to-date/blob/8581d574a0dfab701da75e9699d8576ef25f6f87/lib/index.js#L7-L18 "Source code on GitHub")

The return object of the gitRepoIsUpToDate function.

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

-   `baseCommit` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The commit hash of the merge base commit
-   `errors` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** A list of all errors that occured if there are any
-   `isUpToDate` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if the repo is up to date
-   `localCommit` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The commit hash of the local commit
-   `remoteCommit` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The commit hash of the remote commit
-   `remoteUrl` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The url for the remote repository
-   `repoInfo` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The output of the `git-repo-info` package

### gitRepoIsUpToDate

[lib/index.js:28-91](https://github.com/ibi-group/git-repo-is-up-to-date/blob/8581d574a0dfab701da75e9699d8576ef25f6f87/lib/index.js#L28-L91 "Source code on GitHub")

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](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A path to a file or directory (optional, default `process.cwd()`)

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[gitRepoIsUpToDateReturnObject](#gitrepoisuptodatereturnobject)>**

---
_Source: https://npm.io/package/git-repo-is-up-to-date · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
