刪除本地文件後,想從遠程倉庫中從新Pull最新版文件。
Git提示:up-to-date,但未得到刪除的文件
原因:當前本地庫處於另一個分支中,需將本分支發Head重置至master.
git checkout master
git reset --hard
- 1
- 2
git 強行pull並覆蓋本地文件
git fetch --all
git reset --hard origin/master
git pull
- 1
- 2
- 3
參考資料
1.Why does Git say my master branch is “already up to date” even though it is not?
2. why-does-git-say-my-master-branch-is-already-up-to-date-even-though-it-is-not