git错误“无法用脏工作目录重写分支” [英] git error "Cannot rewrite branch(es) with a dirty working directory"

查看:207
本文介绍了git错误“无法用脏工作目录重写分支”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法用脏工作目录重写分支。

我是Git的新手 - 我尝试使用Google搜索以取得无效的答案。

I am new to Git - I tried googling for an answer to no avail.

这个错误是什么意思?我应该怎么做?

What does this error mean? What should/can I do?

推荐答案

肮脏的工作目录意味着您对分支有未提交的更改。你可以提交或隐藏它们。存储只需使用:

A dirty working directory means you have uncommitted changes to your branch. You can either commit them or stash them. To stash just use:

git stash

然后使用它将您的更改回来

And use this to bring your changes back

git stash apply

这篇关于git错误“无法用脏工作目录重写分支”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆