fatal: bad revision 'undefined'
See original GitHub issueExpected Behavior
Current Behavior
Possible Solution
Steps to Reproduce (for bugs)
https://github.com/bluelovers/ws-dot-properties
- lerna publish
lerna.json
{
"packages": [
"packages/*"
],
"command": {
"publish": {
"ignoreChanges": [
"**/node_modules/**",
"**/__snapshots__/**",
"**/__fixtures__/**",
"**/test/**",
"**/__tests__/**",
"*.map",
"*.spec.*",
"*.test.*",
".gitrepo"
],
"message": "chore(release): publish",
"bump": "patch",
"conventionalCommits": true,
"conventionalGraduate": true
},
"run": {
"stream": true
},
"exec": {
"stream": true
}
},
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent"
}
lerna-debug.log
23 error Error: Command failed: git diff --name-only -- packages/dot-properties-loader
23 error fatal: bad revision 'undefined'
23 error
23 error
23 error at makeError (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\execa\index.js:174:9)
23 error at Function.module.exports.sync (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\execa\index.js:338:15)
23 error at Object.execSync (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\child-process\index.js:26:16)
23 error at diffSinceIn (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\lib\make-diff-predicate.js:63:23)
23 error at hasDiffSinceThatIsntIgnored (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\lib\make-diff-predicate.js:27:18)
23 error at isCandidate (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\collect-updates.js:88:77)
23 error at C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\lib\collect-packages.js:11:9
23 error at Map.forEach (<anonymous>)
23 error at collectPackages (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\lib\collect-packages.js:10:12)
23 error at collectUpdates (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\collect-updates\collect-updates.js:87:10)
23 error at VersionCommand.initialize (C:\Users\User\AppData\Roaming\npm\node_modules\lerna\node_modules\@lerna\version\index.js:188:20)
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.20.2 |
npm --version |
6.14.4 |
yarn --version |
1.22.0 |
node --version |
v13.12.0 |
OS | Version |
---|---|
NAME | VERSION |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:7
Top Results From Across the Web
Git error "fatal: bad revision" when using git diff - Stack Overflow
In your case, you are using the String origin as the <commit> (or revision) you want to compare your working tree to.
Read more >Solved: 'fatal: bad revision' when using git log with BITB...
The error message "bad revision" indicates that the local repository in your build doesn't contain one of the commits you're referencing. This happens...
Read more >Developers - fatal: bad revision 'undefined' - - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >Job to check_links is broken ("fatal: bad revision") - GitLab
Problem to solve The check_links job is currently broken - it results in "fatal: bad revision".
Read more >Error: "fatal: bad object..." during repo sync - Google Groups
Error: "fatal: bad object..." during repo sync ... For some unknown reason, you appear to have a bad revision in your git repo....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bluelovers I got the same issue when I try to publish on merging a feature branch into master in CI environment. It seems to be the
conventional-graduate
option which makes it failed when you don’t have any prerelease packages yet. I removed it and it works now. I still try to figure out how can I make it work if I want to make prereleases in local environment and ensure all prereleases versioned packages are graduated to stable versions in the next merge. Lerna is still new for me so I would wait for more details from someone who knows it better than me.You can do something like this if using GitHub workflows: