git拉代码pull报错:cannot pull with rebase: You have unstaged changes

$ git pull origin master
error: cannot pull with rebase: You have unstaged changes.
error: Please commit or stash them.

根据提示:在执行git pull --rebase命令时,你的工作目录中存在未提交的更改(即未暂存(unstaged)的更改)

解决:
如果你认为你的更改已经准备好可以提交,你可以使用git commit命令来提交它们。提交后,你就可以安全地执行git pull --rebase了。

git add .  # 或者只添加你想要提交的更改
git commit -m "描述你的更改"
git pull --rebase

参考:https://blog.csdn.net/xzzteach/article/details/141112888

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐