search

Home  >  Q&A  >  body text

How is git commit --amend implemented? Why doesn't GitHub support this feature?

Gerrit uses git commit --amend, but GitHub does not support it at all, which feels quite strange.
Which expert knows and can explain it?

滿天的星座滿天的星座2790 days ago611

reply all(3)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-02 09:52:16

    Github supports it, but if you need amend已经push过的内容,修改后push时需要加上-f/--forceparameters

    https://help.github.com/artic...

    reply
    0
  • 阿神

    阿神2017-05-02 09:52:16

    The reason why gerrit adopts this mode is to facilitate viewing and modification. Each amend only forms one push set, and the granularity is small

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:52:16

    Gerrit identifies your patch based on change-Id. For various reasons, the local repository where you originally submitted the code is broken. At this time, you can remove your patch from Gerrit, because you can no longer git commit -a at this time. --amend, you can write your original Change-Id at the bottom of the commit log, or you can submit it to your original change to generate an updated patch.

    reply
    0
  • Cancelreply