how to remove untracked files in Git?

后端 未结 8 1013
鱼传尺愫
鱼传尺愫 2020-12-22 15:22

I\'m working on a branch, say \"experimental\" branch which I branch out from my master branch.Then, I generate a user model in experimental branch, but does not add them to

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 15:47

    Those are untracked files. This means git isn't tracking them. It's only listing them because they're not in the git ignore file. Since they're not being tracked by git, git reset won't touch them.

    If you want to blow away all untracked files, the simplest way is git clean -f (use git clean -n instead if you want to see what it would destroy without actually deleting anything). Otherwise, you can just delete the files you don't want by hand.

提交回复
热议问题