【发布时间】:2021-09-18 21:25:39
【问题描述】:
假设这是我在提交和推送到远程存储库时在我的暂存区域中的课程:
public class Money {
private int amount;
private String currencyCode;
public Money(int amount, String currencyCode) {
this.amount = amount;
this.currencyCode = currencyCode;
}
}
在那之后,我意识到我没有添加应该包含在最后一次提交中的 getter 和 setter。
有没有办法更改已经推送到远程存储库的最后一次提交(添加 getter 和 setter)?
或者我应该只是添加一个新的提交,其中包含一些表明这是对先前提交的改进的消息?
【问题讨论】:
-
你的目标是什么?您已将提交推送到 github,但您修改了最后一次提交,现在您想再次推送修改后的提交吗?
-
这里已经回答了我相信:stackoverflow.com/questions/253055/…
标签: git git-commit git-push