git add
ファイルをインデックス(ステージングエリア)に加えるコマンド。
インデックスに追加されたファイルは、バージョン管理対象になる。
用例
- インデックスに追加されるファイル名を一覧表示
git add -n .
- ファイル「test.txt」をインデックスに追加
git add test.txt
- 拡張子が「.txt」のファイルをインデックスに追加
git add *.txt
- 全てのファイルをインデックスに追加
git add .
書式
git add <追加するファイル> [オプション]
公式によると以下の通り。
git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize] [--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>…]
options
-f | --force | .gitignoreの設定を無視してaddする |
-i | 対話式で実行 |
-n | 追加されるファイルを表示 |
-help | コマンドのヘルプを表示 |
etc.
説明
XXXX
関連
- xxx
参考リンク
- git add - Gitコマンド虎の巻
- Git - git-add Documentation
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
その他メモ
なにかあれば。