Git 刪除本地文件,遠程拉取最新

刪除本地文件後,想從遠程倉庫中從新Pull最新版文件。

Git提示:up-to-date,但未得到刪除的文件

原因:當前本地庫處於另一個分支中,需將本分支發Head重置至master.

  1. git checkout master

  2. git reset --hard

git 強行pull並覆蓋本地文件 : 這招很好用

  1. git fetch --all

  2. git reset --hard origin/master

  3. git pull

轉載至:https://www.jianshu.com/p/648e2046c5ba

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