【发布时间】:2020-03-14 12:56:13
【问题描述】:
我有两次存储,我需要在一次提交中提交两次存储。
我使用git stash apply 来应用最新的存储,但是当我再次使用它时,它会抛出错误,
error: Your local changes to the following files would be overwritten by merge: library/HQ/groupsql.sql Please commit your changes or stash them before you merge. Aborting The stash entry is kept in case you need it again.
如何弹出两个存储然后提交它们。
【问题讨论】:
-
@abby37 它使每个存储都成为提交。
-
在您运行第一次 stash apply 后,您将文件添加到给定的提交,您再次运行 stash apply,然后将文件添加到给定的提交。因此,所有这些存储更改都将通过使用 git commit --amend 在给定的提交中提交
-
有没有可能一次性搞定。
-
我给你的最好建议是:不要。不要尝试像这样组合多个存储。只需应用一个并提交,然后应用下一个并提交,然后使用
git rebase -i压缩这两个提交。
标签: git git-commit git-stash