Languages
[Edit]
EN

Git for Windows - print current working directory in Windows format (Bash)

9 points
Created by:
OneCricketer
460

In this short article, we would like to show how to return the current working directory path (pwd) in Microsoft Windows format using Git Bash under Windows.

Quick solution:

pwd -W

Where: -W works only under Windows Git Bash returning path in the following format: C:/Path/To/Directory.

 

Practical example

In this example, /c means C: drive, so /c/projects will be printed as C:/projects path.

john@DESKTOP-PC MINGW64 /c/projects (main)
$ pwd -W
C:/projects

 

See also

  1. Bash - print current working directory

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join