git 常用指令
2015-05-21 15:28
405 查看
1.git clean -d -x -f
will remove untracked files, including directories (
-d) and files ignored by git (
-x). Replace the
-fargument
with
-nto perform a dry-run or
-ifor 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來處理