git: Switch branch and ignore any changes without committing.

Posted by boyfarrell on Stack Overflow See other posts from Stack Overflow or by boyfarrell
Published on 2009-08-20T07:56:05Z Indexed on 2010/04/22 5:53 UTC
Read the original article Hit count: 179

Filed under:
|
|

Hello,

I have got the git branch I'm working on to a nice place. So I make a commit with a useful commit message. I then absentmindedly make minor changes to the code that are not work keeping. I now want to changes branches, but git gives me,

error: You have local changes to "X"; cannot switch branches.

I thought that I could change branches without committing? If so how can I set this up. If not, how do I get out of this problem? I want to ignore the minor changes without committing and just changes branches!

Cheers,

Dan

© Stack Overflow or respective owner

Related posts about git

Related posts about branching