# When using git commit in a path with spaces, it prompts Cannot read "xxx": No such file or directory

2 messages from 2023-02-16 to 2023-03-27. Participants: L2750558108@outlook.com, Johannes Schindelin.
Thread: https://gitlist.dev/t/59255

## L2750558108@outlook.com, 2023-02-16 16:09

Subject: When using git commit in a path with spaces, it prompts Cannot read "xxx": No such file or directory
Message-ID: <BY5PR14MB35605DDFA6C7F6CD9DF89202B1A09@BY5PR14MB3560.namprd14.prod.outlook.com>
URL: https://gitlist.dev/e/BY5PR14MB35605DDFA6C7F6CD9DF89202B1A09%40BY5PR14MB3560.namprd14.prod.outlook.com

```
In Windows
When using git commit in a path with spaces, it prompts Cannot read "xxx": No such file or directory

Reduce:
1.Init a respository at "C:/te st";
2.cd "C:/te st"
3.git add .
4.git commit
5.fatal: could not read 'C:/te': No such file or directory
```

## Johannes Schindelin, 2023-03-27 08:28

Subject: Re: When using git commit in a path with spaces, it prompts Cannot read "xxx": No such file or directory
Message-ID: <ca58a4a2-dd73-26f5-9d2f-13a658bbaa9b@gmx.de>
URL: https://gitlist.dev/e/ca58a4a2-dd73-26f5-9d2f-13a658bbaa9b%40gmx.de
In-Reply-To: <BY5PR14MB35605DDFA6C7F6CD9DF89202B1A09@BY5PR14MB3560.namprd14.prod.outlook.com>

```
Hi,

On Fri, 17 Feb 2023, L2750558108@outlook.com wrote:

> In Windows
> When using git commit in a path with spaces, it prompts Cannot read "xxx": No such file or directory
>
> Reduce:
> 1.Init a respository at "C:/te st";
> 2.cd "C:/te st"
> 3.git add .
> 4.git commit
> 5.fatal: could not read 'C:/te': No such file or directory

I suspect that your Git version is basically super old, but I cannot know
for sure because vital information has been omitted from this bug report.

And I cannot reproduce (this was done in a PowerShell window):

	PS C:\> git init "te st"
	Initialized empty Git repository in C:/te st/.git/
	PS C:\> cd "te st"
	PS C:\te st> git add .
	PS C:\te st> git commit
	On branch main

	Initial commit

	nothing to commit (create/copy files and use "git add" to track)
	PS C:\te st> git commit --allow-empty -m "works!"
	[main (root-commit) 0d51f36] works!
	PS C:\te st>

In other words, Git has no problem with the space in the working
directory's path.

Ciao,
Johannes

```
