yarnpkg/yarn

Merge conflicts in cache for packages installed via Git

Open

#2,845 建立於 2017年3月6日

在 GitHub 查看
 (1 留言) (8 反應) (0 負責人)JavaScript (41,514 star) (2,731 fork)batch import
cat-buggood first issuehelp wantedtriaged

描述

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?

貢獻者指南