0
0

More than 3 years have passed since last update.

RevertをRevertした時に起きたエラー(備忘録)

Posted at

git revertとは

「既存のコミットを取り消す」コマンドです。
Revertは「コミットを打ち消した」というコミットをpushし、状況を戻すもの。

似たコマンドでは、git resetがあります。
git resetの場合は、そのまま過去に戻しているものです。

本題

アプリを作製中、取り組んでいた機能がうまくいかず1つ前の記述を戻そうとしたところ
そのコミットがすでにrevertされていためrevertされたコミットをrevertする必要が出てきました。

なのでまず

#ログの確認
$ git log 


#最新のコミットに戻す
$ git reset --hard HEAD

で git IDを確認し、その後最新のコミットに戻し

$ git revert "コミットID"

これで呼び戻し完了!
と思いきや、rails sでアプリを起動しようとしたところ

=> Booting Puma
=> Rails 6.0.3.7 application starting in development 
=> Run `rails server --help` for more startup options
warning Integrity check: Top level patterns don't match                        
error Integrity check failed                                                   
error Found 1 errors.                                                          

=====================================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
=====================================================

To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).


yarn check v1.22.10
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.


Exiting

とエラーが出て起動できない笑

なので、エラー文からここだけ読み

=====================================
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
=======================================

Please runなので、yarn install --check-filesを読み込んでね!って言われてます笑

$ yarn install --check-files

ターミナルに打ち込んでインストールして無事完了:relaxed:

最後に

Please run って書いてあったらとりあえず読み込みます笑

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0