ぽっさむのプログラミングまじでわかんないブログ

2021年8月からLightning Web Componentsの勉強はじめまちた。まじでよくわかんない。

GitHub git push --forceは危険

ハッシュ値で特定のコミットに戻ってから、変更を加えて再びプッシュしようとしたら・・

 error: failed to push some refs to 'https://github.com/***/***.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


って出たから、適当に

git push --force


って打ったら戻ったコミットから後のコミットが全部消えてた・・


怖いコマンドだ。もう使いません多分


おしまい