9

I'm trying to use Git Add command to stage a couple of files for committing later. However, I can't seem to add it because Git bash doesn't like a directory with spaces in it. How can get around this issue?

I'm using Win 7 OS. My command looks like the one below:

git add folder1/folder2/new folder/folder3/myFile.txt

The error that I'm getting is the following: new: No such file or directory

Thanks!

2
  • Have you tried quoting the filename and path? git add "folder1/folder2/new folder/folder3/myFile.txt"
    – killermist
    Jan 28, 2015 at 15:55
  • Yes, that was just what James suggested. And it works great. I had no idea you can even do that. haha Jan 28, 2015 at 15:56

1 Answer 1

13

You should be able to get around this problem if you put the path in quotes:

git add "folder1/folder2/new folder/folder3/myFile.txt"
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .