Muni Bus

パソコンの操作方法や設定方法を忘れないようにメモしています。ブログを一回引っ越ししているので、所々表示がかなり乱れています・・・

【Git】コマンドラインでファイルをコミットする

コミットする(変更履歴を記録する)には、gitコマンドのcommitサブコマンドを使う。-mオプションで文字列を指定してコメント(コミットメッセージ)を付ける必要がある。

コミットが成功すると、変更履歴が最新になるため、最後に「nothing added~」のメッセージが表示される。

>git status
On branch master
No commits yet
Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   ○○○
Untracked files:
  (use "git add <file>..." to include in what will be committed)
(以下、表示省略)
>git commit -m "最初の登録"
[master (root-commit) ×××] 最初の登録
1 file changed, □□ insertions(+)
 create mode 100644 ○○○
>git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
(以下、表示省略)
nothing added to commit but untracked files present (use "git add" to track)