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?

More than 1 year has passed since last update.

Gitで環境依存ファイルを管理対象外にする(🔰)

Posted at

チーム開発において、特定の環境のみで必要なファイルをGitの管理から外したいことがあります。そんなときに使える方法のメモです。

1. .gitignoreを使用する

.gitignoreに無視したいファイルやディレクトリを追記することで、それらをGitの管理対象外にできます。しかし、この変更をリモートにプッシュすると、その設定がチーム全体で共有されてしまう点に注意が必要です。

.gitignore
<無視したいファイル名やディレクトリ名>

2..git/info/excludeを使用する

チーム全体での共有を避け、自分の環境だけで無視したい場合は.git/info/excludeを使用します。こちらに追記された内容はリモートには反映されません。

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