-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows git-worktree cannot read the /c/path syntax (a worktree created by cygwin git) #1946
Comments
I fear that this will never by a use case supported by Git for Windows: you have modified your Cygwin setup to not use the What you could do is to create the worktree using Git for Windows instead of Cygwin Git. Cygwin can handle paths of the form |
@dscho Sorry, my path indeed did not start with The reason I used a "/c" style path is that this is the POSIX variant. According to your release notes, Git tries to understand that path in most cases. I am just suggesting you extend that to one more situation. Supporting "/cygdrive/c" would be a hack, but supporting "/c" would be a further step along the path you've chosen. Yes, in that case there would be a burden on Cygwin users to make a bind mount that would make it work from Cygwin. But it's Git's job to read (POSIX) paths, not to ensure that the path actually exists. Workaround for Cygwin (but not Git on Linux): I just discovered both Windows Git and Cygwin Git can read the following type of path: |
Note: my workaround does not work, because It seems POSIX-style relative paths work. I'm not yet sure if it causes any other problem. |
Does gVim support this path: |
Details
A worktree created by Cygwin's Git cannot be used by Git for Windows. This comes up because it's a reasonable workflow to use Git for Windows and Cygwin Git tools at the same time, for example to use the Windows GUI tools but Cygwin for everything else. This issue will also affect repositories on dual-boot systems if the user tries to use a worktree from both OSs.
Cygwin's Git cannot read a Windows-style path, and Git for Windows cannot read a POSIX path. Since the release notes say Git for Windows usually tries to recognize POSIX paths, the most obvious solution is for Git to also recognize POSIX paths in this case. Note: the path is written in
Note: the steps and results are identical if I initialize in /cygdrive/f/Projects/testcase/. The folders are the same, and the POSIX version of the path points to the same directory as the Cygwin path.
fatal: not a git repository: /f/Projects/testcase/.git/worktrees/my-worktree
The file which lists the path is:
The text was updated successfully, but these errors were encountered: