In Git for windows "git bash", how to "print working directory" in Windows path format that is usable by cmd and Windows explorer?

yhd.leung picture yhd.leung · Jun 30, 2017 · Viewed 22.9k times · Source

When using Git for Windows "git bash" on Windows, how to conveniently print the working directory in Windows path representation, e.g.

D:\foo\bar

similar to using 'pwd' to get the Unix representation

/d/foo/bar/

such that the path can be read by Windows explorer and cmd console?

Answer

vestlen picture vestlen · Feb 14, 2018

In Git Bash:

$ cmd //c cd
C:\Program Files\Git

Note the double slash. And for forward slashes, as mentioned in the comments:

$ pwd -W
C:/Program Files/Git