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/info/exclude を使って自分のローカルだけGit管理対象外にする方法

0
Last updated at Posted at 2026-01-12

共同開発をしていると、例えば自分の環境専用の設定ファイルなどをGitの管理対象から外したいことがあります。

ただし.gitignoreに追加すると他のメンバーにも影響するため、「これは自分のローカルだけ無視したい…」というケースでは困ることもあります。

そんなときに使えるのが.git/info/excludeです。

.git/info/exclude とは?

.git/info/excludeは、そのリポジトリのローカル環境だけに適用される.gitignoreのようなファイルです。

項目 .gitignore .git/info/exclude
チームに共有される
ローカルだけに適用

使い方

1. ファイルを開く

vim .git/info/exclude

またはエディタで直接開いてもOKです。

2. 無視したいパスを書く

.gitignoreと同じ書き方でOKです。

.github/instructions/copilot.instructions.md

※ディレクトリも指定できます。

まとめ

やりたいこと 使うもの
全員で無視 .gitignore
自分の環境だけ無視 .git/info/exclude
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?