Quiz: IT Fundamentals Module 05: Version Control with Git (Module 05 of 06)
Test your understanding of the concepts covered in this module.
50 questions
- 1
What is the primary purpose of a version control system?
- 2
Which of the following is NOT a benefit of using version control?
- 3
True or False: Without version control, the most common way to track changes is to copy files into another directory (for example, `project-v1`, `project-v2`), which is simple and error-free.
- 4
What type of version control system is Git?
- 5
What is the key difference between a centralized version control system (like Subversion) and a distributed version control system (like Git)?
- 6
Which of the following best describes a Git repository?
- 7
What is the difference between a local repository and a remote repository?
- 8
Which command creates a new, empty Git repository in the current directory?
- 9
What does the `git clone` command do?
- 10
True or False: When you run `git clone`, you get a full copy of the repository including its entire commit history.
- 11
What are the three main areas (states) that files move through in a Git workflow?
- 12
What is the purpose of the staging area (also called the index) in Git?
- 13
Which command adds a specific file to the staging area?
- 14
What does `git add .` do?
- 15
True or False: Once you stage a file with `git add`, the changes are permanently saved in the repository.
- 16
Which command saves your staged changes as a new snapshot in the repository?
- 17
What is a commit in Git?
- 18
Which of the following is a good commit message?
- 19
True or False: Each Git commit is identified by a unique SHA-1 hash (a long string of letters and numbers like `a1b2c3d4...`).
- 20
What does the `git status` command show you?
- 21
Which command displays the commit history of a repository?
- 22
What does `git log --oneline` do?
- 23
In your own words, describe the three-step workflow of making changes in Git (modify, stage, commit).
This is a free-response question. Write your answer, then click “Show Answer” to compare.
- 24
What is a branch in Git?
- 25
What is the name of the default branch in most Git repositories?
- 26
Which command creates a new branch called `feature/login`?
- 27
Which command switches you to an existing branch called `feature/login`?
- 28
What does `git checkout -b feature/signup` do?
- 29
True or False: When you create a new branch, it starts as an exact copy of the branch you were on when you created it.
- 30
What does the `git merge` command do?
- 31
You are on the `main` branch and want to merge changes from `feature/login` into `main`. Which command do you run?
- 32
What is a merge conflict?
- 33
When a merge conflict occurs, what does Git add to the conflicting file to show you the differences?
- 34
True or False: To resolve a merge conflict, you must manually edit the file to choose which changes to keep, remove the conflict markers, and then stage and commit the result.
- 35
What does the `git remote` command do?
- 36
What does the command `git remote add origin https://github.com/user/repo.git` do?
- 37
Which command uploads your local commits to a remote repository?
- 38
What is the difference between `git pull` and `git fetch`?
- 39
True or False: `git push` sends your local commits to the remote repository, while `git pull` downloads commits from the remote repository and merges them into your local branch.
- 40
Which of the following is a popular web-based platform for hosting Git repositories?
- 41
Which of the following features do platforms like GitHub and GitLab provide? (Select THREE.)Select multiple
- 42
What is a pull request (called a merge request on GitLab)?
- 43
What is the purpose of a `.gitignore` file?
- 44
Which of the following should typically be listed in a `.gitignore` file? (Select THREE.)Select multiple
- 45
True or False: If a file is already being tracked by Git, adding it to `.gitignore` will immediately stop Git from tracking it.
- 46
What is the feature branch workflow?
- 47
In the feature branch workflow, what is the typical sequence of steps to contribute a new feature?
- 48
A developer runs `git status` and sees a file listed under "Changes not staged for commit." What does this mean?
- 49
A team of three developers is working on the same project. Developer A and Developer B both modify the same line in `app.js` on different branches. When Developer B tries to merge their branch into `main` (which already contains Developer A's changes), what happens?
- 50
In your own words, explain why version control with Git is important for software development teams. Include at least two benefits.
This is a free-response question. Write your answer, then click “Show Answer” to compare.