问题描述
如何将git路径从C:\ cygdrive \ c ...更改为C:\或仅更改\ cygdrive \ c \?
How to change git path from C:\cygdrive\c... to C:\ or just \cygdrive\c\?
我已经将notepad ++设置为git的编辑器.当我尝试执行交互式变基(git rebase -i)时,记事本会打开,但由于此奇怪的路径(包括C:\ cygdrive \ c ...
I have setup notepad++ as my editor for git. When i try to perform an interactive rebase (git rebase -i), notepad opens but cannot find the right files for rebasing due to this weird path that include C:\cygdrive\c...
这是记事本++显示的错误消息的图片...
Here is an image of the error message that notepad++ shows...
推荐答案
请确保:
- 使用bash:
C:\cygwin64\bin\bash.exe --login -i
- 使用
cygpath
转换Unix和Windows格式路径:
也就是说:
/cygdrive/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe $(cygpath.exe -w "$*")
但是要将其用于交互式基础,则需要遵循" Cygwin git将错误的路径传递给我的编辑器以提交消息"并将该行包装在shell脚本中.
But for using that for an interactive rebase, you need to follow "Cygwin git passing wrong path to my editor for commit messages" and wrap that line in a shell script.
这篇关于如何从C:\ cygdrive \ c \更改git路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!