Remove file from amended commit

前端 未结 4 1675
北恋
北恋 2021-02-14 01:31

I pushed a commit to a repo where I accidentally added a file. Nobody else has merged from the remote repo so I can rewrite history. But when I remove file(unstage, not remove f

4条回答
  •  逝去的感伤
    2021-02-14 01:46

    While I did something similar to what Colin and ydroneaud have suggested,

    The answer was to use

    git push +sa1:sa1
    

    where sa1 is my branch. This forces to push even 'nothing'.

提交回复
热议问题