question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when working from within a branch worktree

See original GitHub issue

When 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)

  1. Checkout a repo
  2. Checkout a different branch into a separate folder via worktree: git worktree add -b my-branch ../my-branch
  3. CD into the branch folder
  4. Make some changers
  5. 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:open
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pegakcommented, Apr 28, 2022

I will try to find time as it blocks the colleague work flow and I am more focused on platform. 😃

1reaction
zregvartcommented, Oct 25, 2019

@byCedric, well, works on my machine 😄 8.2 had the issue, 8.3 doesn’t. Thank you for fixing it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found