git版本管理系列(七)

git版本管理系列(六)

刪除文件的方法

nelsen-mac:learngit mac$ rm file.txt

這個時候git發現工作區和版本庫就不一致了,git status命令會顯示哪些文件被刪除了: 

nelsen-mac:learngit mac$ git status

On branch master

Changes not staged for commit:

  (use "git add/rm <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)

deleted:    file.txt

no changes added to commit (use "git add" and/or "git commit -a")

 按提示操作,選擇一,git add/rm效果是一樣的

 這樣文件就被刪除了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章