読み方のヒント
矢印ボタン(または ← → キー)でページを移動できます。
git status は、3つの場所の違いを表示します。
cd ~/git-practice/ch1
git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: README.md
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: products.csv
| 見出し | 意味 |
|---|---|
Changes to be committed | ステージにある変更。次のコミットに入る |
Changes not staged for commit | 作業中のファイルにだけある変更 |
Untracked files | Gitがまだ記録の対象にしていない新しいファイル |
nothing to commit, working tree clean | 3つの場所がすべて同じ |
括弧の中の use "..." は、その状態から戻す方法の案内です。第2節では、この案内にある操作を使います。
短い表示がほしいときは -s を付けます。
git status -s
M README.md
M products.csv
左の列がステージ、右の列が作業中のファイルの状態です。M は変更(modified)、?? は記録の対象外のファイル、A は新しく追加したファイルを表します。
3 / 36