我克隆了一个 git repo,然后开始在它的 master 分支中玩耍。过了一会儿,我想忽略我刚刚所做的更改(不提交它们),并切换到不同的分支。但是,它阻止我切换,因为有未提交的更改。我如何在不隐藏它们的情况下忽略它们?这就是发生的事情:
$ git checkout gh-pages
error: Your local changes to the following files would be overwritten by checkout:
somefile.txt
Please, commit your changes or stash them before you can switch branches.
Aborting