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

【備忘録】Gitで自分のローカルでだけ特定ファイルを無視する

Posted at

excludeファイルを使用して.gitignoreと同じ記法で、リポジトリの自分だけの除外設定ができる。

使い方

任意のエディタ等でexcludeファイルを開く

# プロジェクトのルートに移動した上で以下コマンド
code .git/info/exclude

ファイルを開いたら.gitignoreと同じ要領でgitの追跡を無視したいファイル/ディレクトリを指定する。

# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

# ローカル限定の除外設定
.env.local
*.code-workspace
logs/

vscodeに設定を反映させるためにウインドウのリロードを行えばファイルが無視される。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?