Imagine you are working on a group project where everyone writes parts of a story. What does Git help you do?
Think about how you keep versions of your work and share with friends.
Git is a tool that helps you save different versions of your files and work together with others without losing changes.
git status show?You just changed some files in your project folder. You run git status. What information will you see?
git statusThink about how you check what files have been changed before saving them.
The git status command shows which files have been modified, which are ready to be saved (staged), and which are new (untracked).
You made changes to your project and want to save them online so others can see. Which order of commands do you use?
First prepare files, then save locally, then send online.
You first stage files with git add, then save with git commit, and finally upload with git push.
You run git push origin main but get an error. The remote has newer commits that you haven't pulled. What error message will Git show?
Think about what happens if your local branch is not updated properly.
If you try to push when the remote branch has commits your local branch doesn't (i.e., without pulling first), Git refuses because your branch is behind.
When many people edit the same files, conflicts can happen. What is the best way to reduce conflicts?
Think about how to keep your work updated with others' changes.
Pulling often and committing small changes helps keep your work synced and reduces merge conflicts.