search

Home  >  Q&A  >  body text

[git] If you have pushed to the remote branch and find a small problem that needs to be modified, is there a way to achieve the effect of git commit --amend?

When you have pushed to the remote branch, if you execute git commit --amend and then execute git push, an error will be reported, requiring you to execute git pull first. However, after executing git pull, it seems to become merge and cannot be used anymore. Invisible modification. I would like to ask you how to achieve the same effect in this situation.

PHP中文网PHP中文网2870 days ago750

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-02 09:46:20

    No way. There is no way to take back the water that is thrown out, the words that are spoken, and the submission that is pushed out.

    But if you are sure that only you can access your remote warehouse, you can overwrite it with git push -f. If there are multiple people, they may have fetched that commit, and you have to find them and "silence" them.

    reply
    0
  • Cancelreply