严重:pathspec'file.txt'与任何文件均不匹配,GIT [英] Fatal: pathspec 'file.txt' did not match any files, GIT

查看:173
本文介绍了严重:pathspec'file.txt'与任何文件均不匹配,GIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习GIT.按照他们的教程.

I have just started learing GIT. Follow their tutorial.

现在,一开始我就陷入了这个错误:

Now at the very beginning I got stuck with this error:

Fatal: pathspec 'file.txt' did not match any files.

这是我的过程和命令的屏幕截图:

Here is the screenshot of my procedure and commands:

我在这里做错了什么?

What I am doing wrong here?

推荐答案

文件不存在,因此无法添加.确保首先创建了文件.

The files don't exist, so they cannot be added. Make sure the files have been created first.

D:\temp\hi>git init
Initialized empty Git repository in D:/temp/hi/.git/

D:\temp\hi>dir
 Volume in drive D is Data
 Volume Serial Number is 744F-7845

 Directory of D:\temp\hi

2013-11-25  12:59 AM    <DIR>          .
2013-11-25  12:59 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  1,331,387,256,832 bytes free

D:\temp\hi>git add hi.txt
fatal: pathspec 'hi.txt' did not match any files

D:\temp\hi>echo hello > hi.txt

D:\temp\hi>git add hi.txt

D:\temp\hi>dir
 Volume in drive D is Data
 Volume Serial Number is 744F-7845

 Directory of D:\temp\hi

2013-11-25  12:59 AM    <DIR>          .
2013-11-25  12:59 AM    <DIR>          ..
2013-11-25  12:59 AM                 8 hi.txt
               1 File(s)              8 bytes
               2 Dir(s)  1,331,387,256,832 bytes free

这篇关于严重:pathspec'file.txt'与任何文件均不匹配,GIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆