回答編集履歴
3
Fix mistake
answer
CHANGED
@@ -29,4 +29,21 @@
|
|
29
29
|
```console
|
30
30
|
git rm --cache pgsql-data/pg_stat_tmp/global.stat
|
31
31
|
git commit -m "Remove pg_stat_tmp from version control"
|
32
|
+
```
|
33
|
+
|
34
|
+
次のコマンドを実行すると、
|
35
|
+
対象のファイルがGIt 管理から外れているか確認することができます:
|
36
|
+
|
37
|
+
```console
|
38
|
+
$ git ls-files --error-unmatch pgsql-data/pg_stat_tmp/global.stat
|
39
|
+
error: pathspec 'pgsql-data/pg_stat_tmp/global.stat' did not match any file(s) known to git
|
40
|
+
Did you forget to 'git add'?
|
41
|
+
```
|
42
|
+
|
43
|
+
上記のようなメッセージが表示されれば、Git 管理から外れています
|
44
|
+
もし、Git 管理から外れていなければ、次のような出力になります:
|
45
|
+
|
46
|
+
```console
|
47
|
+
$ git ls-files --error-unmatch pgsql-data/pg_stat_tmp/global.stat
|
48
|
+
pgsql-data/pg_stat_tmp/global.stat
|
32
49
|
```
|
2
Fix mistake
answer
CHANGED
@@ -27,7 +27,6 @@
|
|
27
27
|
次のコマンドで Git 管理から外します:
|
28
28
|
|
29
29
|
```console
|
30
|
-
git rm -
|
30
|
+
git rm --cache pgsql-data/pg_stat_tmp/global.stat
|
31
|
-
git add .
|
32
|
-
git commit -m "Remove
|
31
|
+
git commit -m "Remove pg_stat_tmp from version control"
|
33
32
|
```
|
1
Describe details
answer
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
`pgsql-data/pg_stat_tmp/global.stat` は PostgreSQL データベースの一時ファイルのようです:
|
2
2
|
|
3
|
-
[データベースファイルのレイアウト](https://www.postgresql.jp/document/9.4/html/storage-file-layout.html)
|
3
|
+
参考: [データベースファイルのレイアウト](https://www.postgresql.jp/document/9.4/html/storage-file-layout.html)
|
4
4
|
|
5
5
|
開発用に PostgreSQL データベースをお使いですか?
|
6
|
-
本番のデータベース
|
6
|
+
開発のデータベースと本番のデータベースが別のデータベースであれば、
|
7
|
+
こちらのファイルは本番環境には不要と思われますので
|
7
|
-
|
8
|
+
Git の操作で無視する設定を行うとよいでしょう
|
8
9
|
|
10
|
+
## `pgsql-data/pg_stat_tmp` 以下のファイルを Git の操作で無視する方法
|
11
|
+
|
9
12
|
`.git` のある階層に新規テキストファイルを `.gitignore` というファイル名で作成し、
|
10
13
|
次の内容を記述して保存します:
|
11
14
|
|
@@ -17,8 +20,12 @@
|
|
17
20
|
`pgsql-data/pg_stat_tmp/global.stat` が表示されないことを確認しましょう
|
18
21
|
|
19
22
|
ただし、すでに `pgsql-data/pg_stat_tmp/global.stat` を Git 管理に加えてしまった場合は
|
20
|
-
|
23
|
+
`.gitignore` に追加しても引き続き Git 管理されます。
|
21
24
|
|
25
|
+
## Git 管理に含めてしまったファイルを Git 管理から除外する方法
|
26
|
+
|
27
|
+
次のコマンドで Git 管理から外します:
|
28
|
+
|
22
29
|
```console
|
23
30
|
git rm -r --cache pgsql-data/pg_stat_tmp/global.stat
|
24
31
|
git add .
|