-
Open the Git bash.
-
Open your repository in which the file is present to be staged, in the terminal by running the commands “cd <repository name>”, then “dir”.
-
You will see the README.md file present in the repository.

-
Do some changes in the README.md file by editing it in the notepad or VS code. After the changes, It will now become unstaged.

-
Before committing, you have to stage this file.
-
Run the command “git status”. You can see the file which is not staged. It is red in colour.

-
Run the command “git add README.md”, then “git status”.
-
You can now see that the README.md file is staged. It is green in colour.

-
To commit the file, Run the command “git commit -m <A comment>”
(Refer to the picture) -
You have to give a meaningful comment so that it can verify why you have committed this file.
-
Run the command “git status”. You can see that the file has been committed.

- Neha's blog
- Log in or register to post comments

Recent comments