2017-09-16 89 views

回答

0

只需運行以下命令將它們合併在一起:
git reset --soft HEAD~14 && git commit

並在此之後, 推 它像下面,那-f代表
git push -f

結果:
enter image description here

enter image description here

[來源:https://stackoverflow.com/a/5201642/421467]

1
  • 對於第一幅圖片 - 它看起來像提交信息給我

如果你不希望看到的他們只是壓扁這些提交。

  • 對於第二次圖像 - 您不能刪除拉入請求,但你可以通過doing this關閉拉請求,如果不刪除拉請求壁球提交會更好的主意。

請注意,壓扁提交不會刪除您的提交,而是會提交一個提交。

編輯
試試這個命令的擠壓:

git rebase -i HEAD~4 

結果:

pick 01d1124 Adding license 
pick 6340aaa Moving license into its own file 
pick ebfd367 Jekyll has become self-aware. 
pick 30e0ccb Changed the tagline in the binary, too. 

# Rebase 60709da..30e0ccb onto 60709da 
# 
# Commands: 
# p, pick = use commit 
# e, edit = use commit, but stop for amending 
# s, squash = use commit, but meld into previous commit 
# 
# If you remove a line here THAT COMMIT WILL BE LOST. 
# However, if you remove everything, the rebase will be aborted. 
# 
+0

1-對於壁球,我改變了'選'詞'壓扁'一詞,但如何保存並退出?!我使用了三重'Android Studio Terminal'和'Windows命令提示符git console'和'SourceTree Git shell'。 2我之前關閉了拉取請求,但第二張圖片存在!業主是否應該接受一些東西?還有一個問題,你說壓縮提交然後發送另一個拉請求給所有者,將清理第二個圖像? –

+0

1-編輯我的答案是壓扁提交。 2 - 你的意思是第二個圖像?你的意思是「你可以在回購中看到你的封閉評論」?如果這是問題,那麼這是正常的。通過查看你的答案「只需在命令下面運行m .............」就可以看出你的問題已經解決了。 –