本文共 453 字,大约阅读时间需要 1 分钟。
1.git clean -d -x -f
will remove untracked files, including directories (-d
) and files ignored by git (-x
). Replace the -f
argument with -n
to perform a dry-run or -i
for interactive mode and it will tell you what will be removed.
2.git reset --hard
To reset the entire repository to the last committed state
1沒辦法移除原本就有被tracked files,所以必須在靠2,來把有修改過得檔案,也回復到最後的commit state
適合情況:新的一包git trunk抓下來,有修改一些東西,也有build過,但還沒commit,而且回到最初剛抓下來時的樣子時,就適合同時使用1 and 2來處理
转载地址:http://eqsgi.baihongyu.com/