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

前端 未结 14 1209
难免孤独
难免孤独 2021-02-04 11:59

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         


        
14条回答
  •  清歌不尽
    2021-02-04 12:10

    I was doing:

    git add AppName/View Controllers/Sections/Devices/DeviceContainerViewController.swift
    

    But was getting the following error:

    fatal: pathspec 'AppName/View' did not match any files

    As you can see the command is breaking between View & Controllers because there's a space.

    I just had to wrap my path into double quotes. It's not normally necessary, but when you have spaces you need to.

    git add "AppName/View Controllers/Sections/Devices/DeviceContainerViewController.swift"
    

提交回复
热议问题