Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@changesets/git

changesets5.7mMIT3.0.4TypeScript support: included

Some git helpers that changesets use to get information

readme

A tool to manage versioning and changelogs
with a focus on multi-package repositories


npm package View changelog

The changesets workflow is designed to help when people are making changes, all the way through to publishing. It lets contributors declare how their changes should be released, then we automate updating package versions, and changelogs, and publishing new versions of packages based on the provided information.

Changesets has a focus on solving these problems for multi-package repositories, and keeps packages that rely on each other within the multi-package repository up-to-date, as well as making it easy to make changes to groups of packages.

How do we do that?

A changeset is an intent to release a set of packages at particular semver bump types with a summary of the changes made.

The @changesets/cli package allows you to write changeset files as you make changes, then combine any number of changesets into a release, that flattens the bump-types into a single release per package, handles internal dependencies in a multi-package-repository, and updates changelogs, as well as release all updated packages from a mono-repository with one command.

How do I get started?

If you just want to jump in to using changesets, the Intro to using changesets and @changesets/cli docs are where you should head.

If you want a detailed explanation of the concepts behind changesets, or to understand how you would build on top of changesets, check out our detailed-explanation.

We also have a dictionary.

Integrating with CI

While changesets can be an entirely manual process, we recommend integrating it with how your CI works.

To check that PRs contain a changeset, we recommend using the changeset bot, or if you want to fail builds on a changesets failure, run yarn changeset status in CI.

To make releasing easier, you can use this changesets github action to automate creating versioning pull requests, and optionally publishing packages.

Documentation

Cool Projects already using Changesets for versioning and changelogs

Thanks/Inspiration

  • bolt - Brought us a strong concept of how packages in a mono-repo should be able to interconnect, and provided the initial infrastructure to get inter-package information.
  • Atlassian - The original idea/sponsor of the changesets code, and where many of the ideas and processes were fermented. It was originally implemented by the team behind atlaskit.
  • lerna-semantic-release - put down many of the initial patterns around updating packages within a multi-package-repository, and started us thinking about how to manage dependent packages.
  • Thinkmill - For sponsoring the focused open sourcing of this project, and the version two rearchitecture.

changelog

@changesets/git

3.0.4

Patch Changes

  • #1636 f73f84a Thanks @Netail! - Correctly resolve new changesets with since option when the .changeset directory is not directly in the git root

3.0.3

Patch Changes

  • #1620 b15e629 Thanks @Netail! - Make sure that git diff always returns the paths relative to the git root in case diff.relative has been set to true in the git config

3.0.2

Patch Changes

3.0.1

Patch Changes

3.0.0

Major Changes

  • #1185 a971652 Thanks @Andarist! - package.json#exports have been added to limit what (and how) code might be imported from the package.

Patch Changes

2.0.0

Major Changes

  • #1029 598136a Thanks @Andarist! - getCommitsThatAddFiles accepts an options object argument now where you can use cwd option.

    -getCommitsThatAddFiles(paths, cwd);
    +getCommitsThatAddFiles(paths, { cwd });
  • #1029 598136a Thanks @Andarist! - getCurrentCommitId and getCommitsThatAddFiles return full commit hashes now instead of short ones. You can get short ones by using the short: true option.

  • #1029 598136a Thanks @Andarist! - Previously deprecated getCommitThatAddsFile has been removed while getCommitsThatAddFiles is still available.

Minor Changes

  • #1033 521205d Thanks @Andarist! - getChangedPackagesSinceRef accepts now a new changedFilePatterns option. It can be used to determine which packages should be classified as changed. You can pass an array of glob patterns to it.

Patch Changes

1.5.0

Minor Changes

Patch Changes

1.4.1

Patch Changes

  • #889 f64bc1b Thanks @jakubmazanec! - Fixed getCurrentCommitId so that the returned value doesn't contain quotation marks on some Windows machines.

1.4.0

Minor Changes

Patch Changes

1.3.2

Patch Changes

  • #770 eb86652 Thanks @alizeait! - getChangedFilesSince and getChangedPackagesSinceRef will now return the correct absolute paths of the changed files when the passed cwd is different from the repository's root.

  • Updated dependencies [c87eba6]:

1.3.1

Patch Changes

1.3.0

Minor Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

  • 24d7bc9 #495 Thanks @RoystonS! - Automatically deepen shallow clones in order to determine the correct commit at which changesets were added.

  • 24d7bc9 #495 Thanks @RoystonS! - Deprecate the getCommitThatAddsFile function. It's replaced with a bulk getCommitsThatAddFiles operation which will safely deepen a shallow repo whilst processing multiple filenames simultaneously.

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

  • cc8c921 #290 Thanks @mitchellhamilton! - Use @manypkg/get-packages instead of get-workspaces in getChangedPackagesSinceRef. This means getChangedPackagesSinceRef now returns Promise<Package[]>(where Package is from @manypkg/get-packages) rather than Promise<Workspace[]>(where Workspace is from get-workspaces). The notable change is that config was renamed to packageJson and the package objects don't have a name field(use packageJson.name instead).

Patch Changes

0.4.0

Minor Changes

Patch Changes

0.3.0

Minor Changes

  • bca8865 #221 Thanks @mitchellhamilton! - Removed getChangedPackagesSinceMaster and getChangedChangesetFilesSinceMaster and replace them with getChangedPackagesSinceRef and getChangedChangesetFilesSinceRef. The new methods along with getChangedFilesSince also now require arguments as an object with cwd and ref properties to avoid accidentally passing cwd as ref and vice versa

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

  • 89c0894 #167 Thanks @Noviny! - Fix broken sinceMaster arg - which was not working with v2 changesets

0.2.1

Patch Changes

0.2.0

Minor Changes

  • 296a6731 - Safety bump: Towards the end of preparing changesets v2, there was a lot of chaos - this bump is to ensure every package on npm matches what is found in the repository.

Patch Changes

0.1.2

Patch Changes

  • a15abbf9 - Previous release shipped unbuilt code - fixing that

0.1.0

Minor Changes

Patch Changes

  • c46e9ee7 - Use 'spawndamnit' package for all new process spawning