首页 > 解决方案 > 尽管文件存在,但Git找不到该文件

问题描述

尽管文件存在,但Git找不到该文件

下面是Git bash

$ git status
On branch WI
Your branch is up to date with 'origin/WI'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        csvTrainImages 13440x1024.csv

nothing added to commit but untracked files present (use "git add" to track)

BC@DESKTOP-USA MIN ~/Documents/GitHub/A/data (WI)
$ git add csvTrainImages 13440x1024.csv
fatal: pathspec 'csvTrainImages' did not match any files

标签: gitgithub

解决方案


我认为这是由于文件名中的空格。因此,应在终端中提及添加名称以空格分隔的任何此类文件,如下所示:

git add csvTrainImages\ 13440x1024.csv

推荐阅读