2017-09-16 90 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 .............”就可以看出你的问题已经解决了。 –