LoginSignup
20
10

More than 3 years have passed since last update.

error: 'hoge/' does not have a commit checked out

Last updated at Posted at 2020-11-23

 はじめに

新しく作ったファイルをpushしようと思い、

$ git add .

したら、error: 'hoge/' does not have a commit checked outと出た。
.gitがファイルと、ファイルの内のファイルにあったのが原因だった。

解決

このサイトをなぞった。
フロントエンドとバックエンドでファイル一つのファイルにまとめて作るときは、はじめに、リモートに空のファイルををpushしてから、フロント、バックをそのフォルダの中に作成して,add, commit, pushした方がいい。

補足

私の場合は、apiとfrontファイルが一つのファイルにまとまっていたのでややこしくなっていた。ls -laコマンドで、.gitがついているファイルがあるかapi,frontそれぞれ確認し、rm -rf .gitで削除してから, add,commit,pushをすると、成功した。

20
10
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
20
10