yarnpkg/yarn

Merge conflicts in cache for packages installed via Git

Open

#2,845 opened on Mar 6, 2017

View on GitHub
 (1 comment) (8 reactions) (0 assignees)JavaScript (41,514 stars) (2,731 forks)batch import
cat-buggood first issuehelp wantedtriaged

Description

Initial package.json:

    "some-package": "git+ssh://git@github.com/joncursisome-package.git#0.639.0",

Desired package.json (bumped up one version):

    "some-package": "git+ssh://git@github.com/joncursisome-package.git#0.639.0",

Running yarn on the new package.json:

error Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: /Users/jcursi/Library/Caches/Yarn/.tmp/d737a03d45898fb0b871801e2bd41c85
Output:
From ssh://github.com/joncursi/some-package
   c95bf22..a58677f  master     -> origin/master
 * [new tag]         v0.639.0   -> v0.639.0
error: Your local changes to the following files would be overwritten by merge:
	<file name here>
	<file name here>
	<file name here>
Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be removed by merge:
	<file name here>
	<file name here>
	<file name here>
Please move or remove them before you merge.
Aborting
Updating c95bf22..a58677f

The "solution" is to

cd /Users/jcursi/Library/Caches/Yarn/.tmp/d737a03d45898fb0b871801e2bd41c85
git stash

And then re-run yarn in the project root. Is there a better way to tell yarn "yes, please overwrite that package in the cache" other than having to cd into it and git stash every time?

Contributor guide

Merge conflicts in cache for packages installed via Git · yarnpkg/yarn#2845 | Good First Issue