When using the [checkout .] command in git to abandon modifications, why are the newly created folders and files not deleted?
PHP中文网
PHP中文网 2017-05-02 09:48:23
0
2
716

I wanted to use checkout to abandon the modification, but found that the newly created folder and the contents in the folder were not deleted. .

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
習慣沉默

Because the newly created folders and files are ‘Untracked files’, you can use git clean -fd if you want to discard them.

过去多啦不再A梦

Two methods to obtain the git repository:
git init and git clone. The newly added files (including folders) after these two commands are not included in the git repository management. At this time, the status of git st is: Untracked files, which is required Only manual git add can be included in the git warehouse, otherwise git will be out of control.
For such files newly added to the working directory, there is a special command for reverse operation: git clean -fd. You can use man git clean to view command instructions.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template