ファイルの状態を確認する方法を解説します。
以下のコマンドを実行し、ファイルの状態を確認する。
git status
![](https://ootkblog.com/wp-content/uploads/2024/03/git-status-1.png)
これは変更内容はあるが、変更をステージに追加(git add)できていない状態。
変更をステージに追加(git add)する。
![](https://ootkblog.com/wp-content/uploads/2024/03/git-status-2.png)
以下のコマンドを実行し、ファイルの状態を確認する。
git status
![](https://ootkblog.com/wp-content/uploads/2024/03/git-status-3.png)
これはステージに変更が追加されているが、変更を記録(git commit)できていない状態。
変更を記録(git commit)する。
![](https://ootkblog.com/wp-content/uploads/2024/03/git-status-4.png)
以下のコマンドを実行し、ファイルの状態を確認する。
git status
![](https://ootkblog.com/wp-content/uploads/2024/03/git-status-5.png)
これは変更内容はない状態。