git rm–r folder Fatal:pathspec "" did not match any files

Source: Internet
Author: User

Problem Description:

A certain day of the year, when looking at the Git library, it is extremely unreasonable to find the distribution of the file and the name of the folder, so move and rename some files.

An error occurred while deleting (git rm–rfolder) An empty file :fatal:pathspec "folder Name" did not match any files, that is, Git does not find the corresponding file. However, this folder is clearly present, just put the file inside the other folder, this folder is empty.

Problem speculation:

Someone likes to speculate that it is a bad habit, but Wood has a way. In the existing library, new folder ( empty ),git St found in my library does not need to add content, just when

I'm in an empty folder, and when Itouch new file , the library changes. The add file is only displayed when I need it. When I delete the T-ouch file git rm–f new file, the empty folder still exists, but at this point git has no hint of Add.

My analysis: git wide to my empty folder untracked, when I delete, index can not find.

Problem solving:

The clean command for git:git-clean-remove untracked files from the working tree

Git clean–fd untracked folder

Or go to the directory, delete

git rm–r folder Fatal:pathspec "" did not match any files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.