我想临时存储一些修改过的文件,然后使用TortoiseGit恢复更改。就像藏身的东西一样。但我看不到任何选项来选择要存储的文件。任何替代选项,如创建补丁和恢复,也可以有所帮助。
我需要一个快速的解决方案。最好使用GUI。
发布于 2020-11-18 15:36:31
发布于 2020-11-18 17:05:04
根据您的scanario,您可能有不同的选项:
1. If it this only applies to very few files, then you can use the "Commit and restore" feature of TortoiseGit (cf. [https://tortoisegit.org/docs/tortoisegit/tgit-dug-commit.html#tgit-dug-commit-restore](https://tortoisegit.org/docs/tortoisegit/tgit-dug-commit.html#tgit-dug-commit-restore)). Mark a file as "Restore after commit", diff it and make it look as you want to commit it and commit the changes. After the commit the file is restored to the old state.
2. Commit all files to a new branch, switch back to your "old" branch and then compare the "new" branch to the current working tree and re-apply all changes you want to commit (if that are too many changes, you can also hard reset the "old" branch to the new branch and then perform a mixed reset back to the old commit - then you have all changes in your working tree again). This, can then be done again and again until all changes are committed.
发布于 2020-11-18 16:15:05
有一种命令行方法可以创建stash:
git stash -- path/file1 path/file2 ...
创建的stash是一个常规的stash条目,之后您可以通过TortoiseGit的GUI "stash apply"/"stash pop“。
https://stackoverflow.com/questions/64887298
复制相似问题