3

I run git in windows and have project in path c:\projects

I know I can reach this folder in GIT bash by command:

cd /c/projects/

Is it possible somehow make GIT understand Windows path style in order to have possibility run command:

cd "c:\projects\"
5
  • Not that I know of. Your current solution of placing the entire Windows style path in double quotes is how I would do it. Commented Sep 9, 2018 at 7:36
  • 1
    Switch to git CMD? Commented Sep 9, 2018 at 7:36
  • @Tim Biegeleisen You mean that by placing windows style path in double quotes should work? Command cd "c:\projects\" not works in my case Commented Sep 9, 2018 at 7:48
  • Hmmm...maybe it won't work with Windows commands, but it should work with Git commands. Commented Sep 9, 2018 at 7:50
  • Sorry, it works. This is what I was looking for. It is sad that thee is no directory autocomplete function after pressing TAB Commented Sep 9, 2018 at 7:55

2 Answers 2

1

Windows paths are recognized by all git bash programs, since they are running on top of the windows. What is happening is that the backslashes are being interpreted by git bash. Just escape them along with any white spaces and you're good to go:

cd C:\\progects\\
Sign up to request clarification or add additional context in comments.

Comments

1

You can just surround the windows path in Git Bash now (since at least git version 2.26.2.windows.1)

cd "c:\projects\"

The opposite is also true. You can generally use a posix/unix/linux style path in Windows cmd. If it's an absolute path, you just need to replace the drive letter /c with c:

cd "path/to/file"
cd "c:/path/to/file"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.