git 常用操作

本地更新单个文件
git fetch
git checkout origin/master —file_name
 
Push出现问题
git clean -d -f 
 
Automatic merge failed; fix conflicts and then commit the result.放弃本地更改
git reset --hard origin/master 
 
Please commit your changes or stash them before you merge.
 
git commit -m "My message”
git stash
git stash pop
git reset --hard 
 
用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard
git pull
posted @ 2021-02-24 16:46  临江仙贝塔  阅读(58)  评论(0编辑  收藏  举报