Git Exercises

Ques.4- Stage the changes

Ans- Here's an example of the commands:


$ git status
On branch main
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: index.html

no changes added to commit (use "git add" and/or "git commit -a")

$ git add index.html

$ git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)

modified: index.html

$ git commit -m "Update index.html"

In this example, the `index.html` file is modified, and we stage the changes using `git add index.html`. After staging, we verify the status with `git status`, and then we commit the changes with the descriptive message "Update index.html" using `git commit -m "Update index.html"`.


Remember to provide a descriptive commit message that explains the changes you have staged.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext