1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Vite】git statusしたらUntracked files:で 〜/.vite/配下に知らないファイルができていた。

Posted at

はじめに

 git status でローカルのファイルの差分を見たら、身に覚えのないファイルがUntracked files:で大量に表示された…。

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        〜/.vite/deps/chunk-〇〇〇〇.js
        〜/.vite/deps/chunk-〇〇〇〇.js.map
        〜/.vite/deps/react-dom_client.js
        〜/.vite/deps/react-dom_client.js.map
        〜/.vite/deps/react.js
        〜/.vite/deps/react.js.map

問題

 意図しない差分で、ほっておけない。なんのファイルかわからないので差分として管理するべきか判断がつかない。

.viteの正体

 調べたところ、ビルド時に生成されるキャッシュや設定ファイルを格納するディレクトリでした。
なので除外して問題なさそうですね。

解決方法

.gitignoreで.viteを除外する。

.gitignore に/.vite/ を追加

その他除外ファイル
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
/.vite/ 
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
その他除外ファイル

おわりに

 まだ、viteやReactは、すべてのファイルやディレクトリを完全に理解しているわけではないのでこのようなエラーや記事制作を通して理解を深めたいです。

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?