Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre 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

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you explain what "staging" means in Git?

What happens if I forget to add a file before committing?

How do I see a list of my previous commits?

bookSaving Your Work with Git

Glissez pour afficher le 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

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
some-alt