2

How to change git path from C:\cygdrive\c... to C:\ or just \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...

enter image description here

SRG
  • 249
  • 3
  • 13
  • Notepad is NOT a cygwin application and can NOT understand the `/cygdrive`. Use the equivalent windows path – matzeri Apr 17 '18 at 05:48
  • @matzeri you mean when setting the core.editor variable in git? git config --global core.editor "using windows path here"? – SRG Apr 17 '18 at 09:06

1 Answers1

1

Make sure to:

  • use bash: C:\cygwin64\bin\bash.exe --login -i
  • use cygpath to convert Unix and Windows format paths:

That is:

/cygdrive/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe $(cygpath.exe -w "$*")

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250