How do I push amended commit to the remote Git repository?

后端 未结 16 1651
深忆病人
深忆病人 2020-11-22 04:42

When I\'ve worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the

16条回答
  •  执念已碎
    2020-11-22 04:45

    I just kept doing what Git told me to do. So:

    • Can't push because of amended commit.
    • I do a pull as suggested.
    • Merge fails. so I fix it manually.
    • Create a new commit (labeled "merge") and push it.
    • It seems to work!

    Note: The amended commit was the latest one.

提交回复
热议问题