Error when working from within a branch worktree
See original GitHub issueWhen trying to run commitlint from within a branch worktree directory, I get the following error: could not find git root from undefined
Expected Behavior
The operation should succeed without error.
Current Behavior
The operation errors with could not find git root from undefined
Affected packages
- cli
- core
- prompt
- config-angular
Steps to Reproduce (for bugs)
- Checkout a repo
- Checkout a different branch into a separate folder via worktree:
git worktree add -b my-branch ../my-branch
- CD into the branch folder
- Make some changers
- Try to commit
Your Environment
Executable | Version |
---|---|
commitlint --version |
8.1.0 |
git --version |
git version 2.20.1.windows.1 |
node --version |
v10.14.1 |
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Why am I getting the message, "fatal: This operation must be ...
gives an error "fatal: This operation must be run in a work tree". You can't check it out either: Initialized empty Git repository...
Read more >git-worktree Documentation - Git
A git repository can support multiple working trees, allowing you to check out more than one branch at a time. With git worktree...
Read more >git worktree fails only for master branch - Google Groups
I'm working on some server-side software to do a merge. By using git worktree it's possible to check out a given branch for...
Read more >Git Worktrees are not so Scary - Waylon Walker
If you try to checkout a branch that is checked out in a linked worktree, you will be presented with an error, and...
Read more >How to Use Git Worktree | Checkout Multiple Git Branches at ...
This video includes a Git worktree example, so you can learn how to use this feature to checkout and work on multiple Git...
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
I will try to find time as it blocks the colleague work flow and I am more focused on platform. 😃
@byCedric, well, works on my machine 😄 8.2 had the issue, 8.3 doesn’t. Thank you for fixing it.