How to remove local (untracked) files from the current Git working tree

前端 未结 30 2208
死守一世寂寞
死守一世寂寞 2020-11-22 00:07

How do you delete untracked local files from your current working tree?

30条回答
  •  死守一世寂寞
    2020-11-22 00:44

    User interactive approach:

    git clean -i -fd
    
    Remove .classpath [y/N]? N
    Remove .gitignore [y/N]? N
    Remove .project [y/N]? N
    Remove .settings/ [y/N]? N
    Remove src/com/arsdumpgenerator/inspector/ [y/N]? y
    Remove src/com/arsdumpgenerator/manifest/ [y/N]? y
    Remove src/com/arsdumpgenerator/s3/ [y/N]? y
    Remove tst/com/arsdumpgenerator/manifest/ [y/N]? y
    Remove tst/com/arsdumpgenerator/s3/ [y/N]? y
    

    -i for interactive
    -f for force
    -d for directory
    -x for ignored files(add if required)

    Note: Add -n or --dry-run to just check what it will do.

提交回复
热议问题