git checkout fail " error: The following untracked working tree files would be overwritten by checkout: "

error: The following untracked working tree files would be overwritten by checkout:


Remove all untracked files:

git clean  -d  -fx .


  • -x means ignored files are also removed as well as files unknown to git.
  • -d means remove untracked directories in addition to untracked files.
  • -f is required to force it to run.

reference:
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-clean.html
https://stackoverflow.com/questions/17404316/the-following-untracked-working-tree-files-would-be-overwritten-by-merge-but-i/35067275

留言

這個網誌中的熱門文章

NMEA標準格式 -- GPS

網路 Transformer 的用途

cut,sed,awk 字串處理