LoginSignup
0
1

More than 3 years have passed since last update.

ローカルでしか使わないファイルをGit管理から除外する方法

Last updated at Posted at 2020-02-24

Git管理したくないファイルパスを .git/info/excluede に書き込め。

# local_only.sh をGit管理から外すぞ
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    local_only.sh

nothing added to commit but untracked files present (use "git add" to track)

# .git/info/excluede に追記するぞ
$ echo localonly.sh >> .git/info/excluede

# やるやんけ
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

これでうっかりコミットするようなことがなくなります。

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