To remove these files, which have been populated in our repository unwantedly, you just call for a napalm strike on them! That's right, from the earlier command you just exclude the exclusion part.
git clean –f
This should give an output as shown in the following screenshot:
The clean
command removes all untracked files from your current repository. The –f
parameter forces git clean
to remove those untracked files from your repository.
The following is the list of parameters you can put to use with git clean
:
Parameter |
Action description | |
---|---|---|
Short form |
Full form | |
|
Removes untracked files | |
Removes untracked directories along with files | ||
|
Doesn't remove anything, but show what will be done | |
|
Stays quiet and only reports errors but not the files that were successfully removed | |
|
Excludes the... |