Git Bash for Windows showing / expecting file paths with a forward slash, no colon colon

I installed Git extensions that automatically downloaded and installed Git for Windows, and when I use Git Bash it shows the file path as / c / whatever / folder, not C: \ whatever \ folder, and if I paste the path from explorer Windows, it chokes on it because it expects pending slashes and no colon after the drive letter.

When I previously installed Git for Windows myself, it showed forward slashes / colons correctly, but was much more limited and difficult to use (especially with copy / paste).

Why is it showing / expecting file paths with a forward slash and no colon, and how can I fix it ?!


source to share

2 answers

You can also try adding single quotes to the directory path copied from Windows Explorer and pasting into the terminal prompt (e.g. cd 'D: \ Documents \ Developer Tools and Docs'). This worked for me. Check out the solution posted at the following link: Escaping backslashes in paths of windows passed to unix programs



This works because it \

is an escape character in the Unix / Linux world. If the path you are inserting looks like c:\\somefolder\\anotherfolder

that would be ok because it \\

says "I need a literal \

. That being said, my git bash understands one \

, if the path does not end, so it cd c:\folder

works but cd c:\folder\

doesn't work.

BTW what kind of error message does it give you when it chokes and you can give an example of a nested path that it chokes.



All Articles