在Windows上使用Git更新文件

时间:2012-06-08 20:35:41

标签: windows git

我最近安装了Git,我正在尝试使用此命令更新文件: (在Windows 7上)

git add Probe.txt

但它说“致命:pathspec'探测'与任何文件都不匹配” 我在文件所在的目录中。事实上,如果我尝试git status,我会“已修改:Probe.txt ”。

我应该如何更新我的文件?

2 个答案:

答案 0 :(得分:2)

尝试git add .,它会添加所有内容。不知道为什么特定的文件名不起作用,但这绝对应该。

答案 1 :(得分:2)

看起来你实际上是因为某种原因在“探测”之后进入了一个空间,请注意:

~% cd /tmp
/tmp% mkdir foo
/tmp% cd foo
foo% git init
Initialized empty Git repository in /tmp/foo/.git/
foo% git add probe .txt
fatal: pathspec 'probe' did not match any files
foo%

我目前不在Windows上,但我认为你可以理解。

如果您确定不是这种情况,请在设置

后重新尝试命令
set GIT_TRACE=1

并按git add Probe.txt的输出更新您的问题,以便我们进一步猜测。