git-23_pull failed

Can not pull: You have unstaged changes

testgit@VM8:[~/ers](master)$ git pull --rebase
 Cannot pull with rebase: You have unstaged changes.
 Please commit or stash them.

Reason: Some files have been changed, when you merge latest commit in remote repository, these files have conflict changes. So Git won’t let you do this.
Solution: Note: DO the operation under root directory.
1). If you want to keep your changes and continue pull operations:

$git stash         #备份工作区
$git pull --rebase
$git stash pop     #恢复最后一次保存

2). If you want a clear environment and reject all your changes:

$git clean -dfx     #删除新创建的文件
$git checkout -- .  #丢弃本次修改
$git pull --rebase
发布了38 篇原创文章 · 获赞 3 · 访问量 6670

猜你喜欢

转载自blog.csdn.net/zhanghuanhuanzhh/article/details/88742013
今日推荐