Git强制覆盖还原本地救火命令
生活随笔
收集整理的這篇文章主要介紹了
Git强制覆盖还原本地救火命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
講述
什么時候回使用這組命令呢?
嘿嘿,是不是快要闖禍了,git版本庫各種報錯呢,趕快的搶救下呢,哈哈哈哈,是的,這組命令和git clone很相似啊,
只不過強制覆蓋命令簡單點,不用重新clone了,就把源碼更新到了正常的狀態了。
·來看下吧!這組神奇的滅火命令!
git fetch --all git reset --hard origin/master git pull副作用:原版本庫的文件會被進行還原,自己的新建的文件原版本庫沒有的文件不會有影響,還是存在的。也可以這樣,那么本地修改的文件就還是存在的,也不錯!!! git fetch --all git reset --hard origin/master git pull實踐
Administrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git fetch --all Fetching originAdministrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git reset --hard origin/master HEAD is now at 8ebf5a3 進行驗證正整數的函數:大家還記得嗎 有點冷門啊~~~filter_car($a,filter_validate_int)Administrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git pullAlready up to date.Administrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git fetch --all Fetching originAdministrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git reset --soft origin/masterAdministrator@Jim MINGW64 /d/phpstudy/PHPTutorial/WWW/CodePractice (sunx) $ git pull Already up to date.https://blog.csdn.net/Pnoter/article/details/90232918
總結
以上是生活随笔為你收集整理的Git强制覆盖还原本地救火命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP配置虚机权限不足的问题
- 下一篇: 超境汽车的超境赛博骑士使用的碳纤维是什么