[英]Update file with Git on Windows
I recent installed Git and I'm trying to update a file using this command: (On windows 7) 我最近安装了Git,我正在尝试使用此命令更新文件:(在Windows 7上)
git add Probe.txt
But it says " fatal: pathspec 'probe' did not match any files " I'm in the directory which the file is. 但它说“ 致命:pathspec'探测'与任何文件都不匹配 ”我在文件所在的目录中。 In fact, if I try
git status
I get " modified: Probe.txt ". 事实上,如果我尝试
git status
我会得到“ modified:Probe.txt ”。
How should I update my file? 我该如何更新我的文件?
try git add .
试试
git add .
which will add everything. 这将添加一切。 Not sure why the specific filename isn't working, but this definitely should.
不知道为什么特定的文件名不起作用,但这绝对应该。
Looks like you're actually entering a space after "Probe" for some reason, observe: 看起来你实际上是因为某种原因在“探测”之后进入了一个空间,观察:
~% 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%
I'm not on Windows at the moment but I think you can get the idea. 我目前不在Windows上,但我认为你可以得到这个想法。
If you're pretty sure it's not the case, please re-try your command after setting 如果您确定不是这样,请在设置后重新尝试命令
set GIT_TRACE=1
and update your question by the output of git add Probe.txt
so we could guess further. 并通过
git add Probe.txt
的输出更新您的问题,以便我们进一步猜测。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.