Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对我的一个分支中的代码进行了很多更改。所有这些更改都与精心设置的测试状态有关。现在我想删除所有这些更改,因为我正在处理其他事情并且这些更改正在阻碍。我希望将来可以进行更改以用于测试目的。有可能吗?
你描述了git stash这里的工作。
git stash
在您的分支上,只需键入:
然后签出另一个分支,工作工作工作,提交提交,然后回到您的测试分支:
git stash pop
你有很多选择git stash,所以git help stash推荐!
git help stash
当然。有2种方式。如果您的更改尚未提交 - 创建新分支 testFeature 并提交到此分支。当你完成你的功能时,你将把这个分支合并到 master 中。甚至更简单。只是git stash用于那些临时的东西。