Info
Open the page on your phone

What command is used to save changes made in Git?

To save changes made in Git, the git commit command is used. This command records changes from the working directory to the Git index, and then creates a new commit containing those changes.

The syntax of the git commit command is as follows:

                        
git commit [-m "commit message"]

                        
                    

The -m option is used to add a comment to the commit. The commit message should describe the changes that were made.

For example, to commit changes to the index.html file, you can run the following command:

                        
git commit -m "Added new section" index.html

                        
                    

This command will add a new commit with the comment "Added new section" to the index.html file.

If you want to commit all changes in the working directory, you can run the command without any options:

                        
git commit

                        
                    

This command will add a new commit with the comment "No comment" to the working directory.

After running the git commit command, the changes will be recorded in Git and will be available for recovery or sharing with others.