How to commit a change with Git in the terminal

Omar Shishani
2 min readMar 10, 2021

--

Step 1: Navigate to File in Terminal

Open the terminal, or command line, and navigate to the folder of the file you wish to commit the changes of. You can do this in the Windows Command Prompt by using cd "C:\path\to\file"

Step 2: git add

Use git add to add one or several files to the git staging area. These files are recorded in the staging area, and in the next step their changes will be committed.

Step 3: Check Status (Optional)

Use git status to check which files are staged for changes. You should see a message such as that below:

Git status

Step 4: git commit -m "Type your message here"

Use the command git commit -m "Type your message here" to commit the changes. You should get a success message with something like "1 file changed...". See below:

Git commit

Step 5: Pat yourself on the back.

Congratulations! You’re done.

Sunset cliffs

Smoke bomb girl by Tyler Kaslik on Unsplash

Cliffs by by v2osk on Unsplash

--

--

Omar Shishani
Omar Shishani

Written by Omar Shishani

Hi! I am a React developer who loves technology and learning new things in all different fields. https://omarshishani.com

No responses yet