Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: a.py new file: folder0/folder0.py new file: folder0/folder00/folder00.py
Untracked files: (use "git add <file>..." to include in what will be committed) b.py folder0/folder00/folder00_v2.py folder0/folder01/
$ git clean -f -d -i --dry-run Would remove the following items: b.py folder0/folder00/folder00_v2.py folder0/folder01/ *** Commands *** 1: clean 2: filter by pattern 3: select by numbers 4: ask each 5: quit 6: help What now> h clean - start cleaning filter by pattern - exclude items from deletion select by numbers - select items to be deleted by numbers ask each - confirm each deletion (like "rm -i") quit - stop cleaning help - this screen ? - helpfor prompt selection Would remove the following items: b.py folder0/folder00/folder00_v2.py folder0/folder01/ *** Commands *** 1: clean 2: filter by pattern 3: select by numbers 4: ask each 5: quit 6: help What now> c Would remove b.py Would remove folder0/folder00/folder00_v2.py Would remove folder0/folder01/
按规则忽略文件,也就是匹配到规则的图片不进行删除:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ git clean -f -d -i --dry-run Would remove the following items: b.py folder0/folder00/folder00_v2.py folder0/folder01/ *** Commands *** 1: clean 2: filter by pattern 3: select by numbers 4: ask each 5: quit 6: help What now> f b.py folder0/folder00/folder00_v2.py folder0/folder01/ Input ignore patterns>> *folder* b.py Input ignore patterns>> Would remove the following item: b.py *** Commands *** 1: clean 2: filter by pattern 3: select by numbers 4: ask each 5: quit 6: help What now> c Would remove b.py