Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Saving Your Work with Git | Getting Started with Version Control
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Git and GitHub for Absolute Dummies

bookSaving Your Work with Git

When you use Git, you can save your work at different stages, just like taking snapshots of your project as it changes. Each time you save, you create a commit, which is a record of your files at that exact moment. This is helpful because you can look back and see what changed, when, and why. If something goes wrong, you can return to a previous snapshot, making it easy to fix mistakes or recover lost work.

# Prepare a file to be saved in Git
git add filename

When you add a file with git add, you are telling Git to get that file ready for saving. This step is important because Git won't save changes unless you specifically include them. You might edit several files, but only the ones you add will be part of your next snapshot. This means you have control over exactly what gets saved each time you commit. After you add your files, you're ready to save your work.

# Save your changes with a message describing what you did
git commit -m "Describe what changed"

1. What does 'git add' do?

2. Why do you write a message with git commit?

3. What is a 'commit' most like?

question mark

What does 'git add' do?

Select the correct answer

question mark

Why do you write a message with git commit?

Select the correct answer

question mark

What is a 'commit' most like?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2

Ask AI

expand

Ask AI

ChatGPT

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

bookSaving Your Work with Git

Swipe to show menu

When you use Git, you can save your work at different stages, just like taking snapshots of your project as it changes. Each time you save, you create a commit, which is a record of your files at that exact moment. This is helpful because you can look back and see what changed, when, and why. If something goes wrong, you can return to a previous snapshot, making it easy to fix mistakes or recover lost work.

# Prepare a file to be saved in Git
git add filename

When you add a file with git add, you are telling Git to get that file ready for saving. This step is important because Git won't save changes unless you specifically include them. You might edit several files, but only the ones you add will be part of your next snapshot. This means you have control over exactly what gets saved each time you commit. After you add your files, you're ready to save your work.

# Save your changes with a message describing what you did
git commit -m "Describe what changed"

1. What does 'git add' do?

2. Why do you write a message with git commit?

3. What is a 'commit' most like?

question mark

What does 'git add' do?

Select the correct answer

question mark

Why do you write a message with git commit?

Select the correct answer

question mark

What is a 'commit' most like?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
some-alt