Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Making Your First Commit | Introduction to Git
Git Essentials

bookMaking Your First Commit

You have already learned that a commit in Git represents a snapshot of your project at a specific point in time. Now, explore how to make a commit.

Making a Commit

To commit your changes, run the following command:

git commit -m "Commit message"

Replace "Commit message" with a short description of the changes made. A commit message can be either brief or detailed, depending on the context. For now, use concise messages.

Before making the first commit, check the status of the working tree and the staging area.

Since the only change made so far is adding a new text file, the commit command will be:

Run this command in the terminal:

Staging and committing changes

The changes from the staging area are now committed.

Commit Workflow

Commit workflow

Here is the process of committing a change to the repository:

  1. Add the file from the working tree to the staging area;
  2. Commit this change to the repository.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 8

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Awesome!

Completion rate improved to 3.57

bookMaking Your First Commit

Swipe to show menu

You have already learned that a commit in Git represents a snapshot of your project at a specific point in time. Now, explore how to make a commit.

Making a Commit

To commit your changes, run the following command:

git commit -m "Commit message"

Replace "Commit message" with a short description of the changes made. A commit message can be either brief or detailed, depending on the context. For now, use concise messages.

Before making the first commit, check the status of the working tree and the staging area.

Since the only change made so far is adding a new text file, the commit command will be:

Run this command in the terminal:

Staging and committing changes

The changes from the staging area are now committed.

Commit Workflow

Commit workflow

Here is the process of committing a change to the repository:

  1. Add the file from the working tree to the staging area;
  2. Commit this change to the repository.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 8
some-alt