Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git error "Cannot rewrite branch(es) with a dirty working directory"

Tags:

git

"Cannot rewrite branch(es) with a dirty working directory".

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

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

like image 474
jldupont Avatar asked Jan 08 '10 20:01

jldupont


1 Answers

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
like image 102
jonescb Avatar answered Oct 21 '22 19:10

jonescb