Complete Version Control with Git Coursera Quiz Answers [2025 Edition]

Get All Modules Version Control with Git Coursera Quiz Answers

Version Control with Git Module 01 Assessment Answers

Q1. Which one of these statements about Git is true?

  • Git helps manage the history of the project.

Explanation: Git is a version control system that tracks and manages the history of a project, recording changes to the code over time.

Q2. Which one of these statements about branches is true?

  • The default branch is named “master”.

Explanation: By default, the main branch in Git is named “master,” though many repositories now use “main” as the default branch name.

Q3. What is a request to merge your branch into another branch called?

  • Pull request

Explanation: A pull request is a way of proposing changes in one branch to be merged into another, typically used in collaborative repositories.

Q4. If a remote repository is offline, which one of the following is true?

  • You can continue to work with the local repository.

Explanation: Since Git uses a distributed version control system, you can work offline with the local repository and sync changes once the remote repository is available.

Q5. Which one of the following is true?

  • Git implements distributed version control.

Explanation: Git is a distributed version control system, meaning each user has a local copy of the full repository, and changes can be committed locally before being shared with others.

Q6. Which one of these statements about commits is true?

  • A commit is a snapshot of the project.

Explanation: A commit captures the state of the entire project at a particular point in time, preserving all changes made.

Q7. Which location contains the list of files that will be included in the next commit?

  • Staging area

Explanation: The staging area, also known as the index, contains files that have been added and are ready to be included in the next commit.

Q8. Which location contains the commit history of a project?

  • Remote repository

Explanation: The branch holds the commit history of the project, which is a sequence of commits that represent the evolution of the project.

Q9. When a file is first placed in the working tree, what is its status?

  • Untracked

Explanation: When a new file is placed in the working tree, it is considered untracked until it is added to the staging area.

Q 10. What must you do to add a new file to the next commit?

  • Add the file to the staging area.

Explanation: Before committing a new file, it must be added to the staging area using git add.

Q11. If you create a local repository in a folder with existing files, what will be the status of the files?

  • Untracked

Explanation: New files in the working tree are initially untracked by Git until they are added to the staging area.

Q12. Immediately after you commit, where is the commit located?

  • Local repository

Explanation: After a commit, the changes are stored in the local repository. The remote repository is updated later by pushing the changes.

Q13. Which one of these statements about remote repositories is true?

  • By convention, remote repository names end in “.git”.

Explanation: The URL of a remote repository commonly ends with .git, indicating that it is a Git repository.

Q14. What is a local copy of a remote repository called?

  • Clone

Explanation: When you clone a remote repository, you create a local copy of it, including all branches and commit history.

Q15. After you clone a repository, which one of the following is true?

  • The remote repository information is available in the local repository.

Explanation: When you clone a repository, the local copy retains information about the remote repository, such as its URL, so that changes can be pushed and pulled.

Q16. What is the origin?

  • An alias for the remote repository’s URL.

Explanation: In Git, “origin” is the default name given to the remote repository’s URL, representing the source from which the repository was cloned.

Q17. What must you do to add a local commit to the remote repository?

  • Push

Explanation: To add your local commits to the remote repository, you must push the changes using the git push command.

Version Control with Git Module 02 Assessment Answers

Q1. In Git, what is modeled as a directed acyclic graph?

  • The commit history.

Explanation: In Git, the commit history is represented as a directed acyclic graph (DAG), where each commit points to its parent commit(s) without forming any cycles.

Q2. How are Git commits connected?

  • A commit references its parent(s).

Explanation: Each Git commit contains a reference to its parent commit(s), which allows Git to track the sequence and history of changes.

Q3. What is a Git ID?

  • The name of a Git object.

Explanation: A Git ID, typically a SHA-1 hash, uniquely identifies objects in Git, such as commits, branches, and tags.

Q4. If a large file changes by one character, what would you expect to happen to its corresponding SHA-1 value?

  • It would change drastically.

Explanation: SHA-1 hashing algorithms produce a completely different hash even if a single character of the file changes.

Q5. What do branch labels point to?

  • The most recent commit of a branch.

Explanation: Branch labels in Git point to the latest commit on that branch, which represents the current state of the branch.

Q6. How many HEAD references are in a local repository?

  • One.

Explanation: A Git repository has a single HEAD reference that points to the current branch or commit in the repository.

Q7. Which one of these statements is correct?

  • A tag always points to a specific commit.

Explanation: Tags in Git are references that point to specific commits, often used to mark release points or milestones in the project’s history.

Q8. What happens when a branch is created?

  • A branch label is created.

Explanation: When a branch is created, Git creates a new branch label pointing to the current commit. No commits are copied; instead, the new branch shares the commit history with the original branch.

Q9. Which one of these statements is correct?

  • Checkout updates the working tree and HEAD reference.

Explanation: The git checkout command updates both the working directory (working tree) and the HEAD reference to point to the specified branch or commit.

Q10. What does a detached HEAD mean?

  • The HEAD reference points directly to a commit SHA-1.

Explanation: A detached HEAD means the HEAD reference is not pointing to a branch but directly to a specific commit, often occurring when checking out an older commit.

Q11. What does “deleting a branch” immediately do?

  • Deletes a branch label.

Explanation: When you delete a branch in Git, it removes the branch label, but the commits are still part of the project history unless they are orphaned.

Q12. Which one of the following statements is true?

  • Merging combines the work of branches.

Explanation: Merging is the process of combining changes from two branches, integrating the work done on both.

Q13. Which one of the following statements about fast-forwarding merges is true?

  • The merge moves a branch label.

Explanation: In a fast-forward merge, Git simply moves the branch label forward to the latest commit of the other branch, without creating a new merge commit.

Q14. If Git informs you that a fast-forward merge is not possible, which one of these statements is most likely to be true?

  • A commit was made on the base branch after the topic branch was created.

Explanation: A fast-forward merge is not possible if the base branch has received new commits since the topic branch was created, requiring a more complex merge.

Q15. Which one of these statements about a merge involving a merge commit is true?

  • Git places the result of the merge into a new commit.

Explanation: A merge commit is created when there are multiple branches involved in the merge, and it contains the combined changes from both branches.

Version Control with Git Module 03 Assessment Answers

Q1. Which one of the following statements about merge conflicts is true?

Answer: Merge conflicts occur when a person needs to make a decision.

Exp lanation:A merge conflict happens when Git is unable to automatically merge changes from two branches and requires manual intervention to decide which changes to keep.


Q2. Assume that you have a topic branch merging into a base branch. Which one of the following is involved in resolving a merge conflict?

Answer: Adding file(s) to the staging area.

Explanation: After resolving a merge conflict manually, you need to add the modified files to the staging area before committing the merge.


Q3. Assume that you have a topic branch merging into a base branch. Which one of these situations is most likely to create a merge conflict?

Answer: Both branches update the header in README.md.

Explanation: If both branches modify the same part of a file (e.g., the header in README.md), Git will not know which changes to keep, resulting in a merge conflict.


Q4. Which one of the following statements is true?

Answer: A tracking branch label sometimes points to the same SHA-1 as the remote branch label.

Explanation: Tracking branches often point to the same commit as the remote branch but may diverge if changes are made locally and not pushed yet.


Q5. Which one of the following is most likely to have tracking branches?

Answer: A local repository.

Explanation: Tracking branches are typically found in a local repository, where they keep track of remote branches for synchronization.


Q6. Immediately after you clone a repository, which one of these statements is most likely to be true?

Answer: The tracking branch label and local branch label point to the same commit.

Explanation: When you clone a repository, the local branch and its corresponding tracking branch are synchronized to the same commit.


Q7. If you perform a fetch and new objects are retrieved, which one of these is most likely to be true?

Answer: The tracking branch label will point to a new commit.

Explanation: Fetching updates the tracking branches with the latest commits from the remote repository without affecting the local branches.


Q8. Which one of these statements is true?

Answer: Fetch does not update the local branch tip.

Explanation: The git fetch command updates the tracking branches but does not update the local branches; this requires a merge or rebase.


Q9. Which one of these statements is true?

Answer: Pull combines fetch and merge.

Explanation: The git pull command is a combination of git fetch (retrieving changes from the remote) and git merge (integrating those changes into the local branch).


Q10. A pull may result in which one of the following?

Answer: A fast-forward merge.

Explanation: A pull can result in a fast-forward merge if the local branch is behind the remote branch, meaning no merge commit is needed.


Q11. When should you avoid rebasing a branch?

Answer: If you have shared the branch.

Explanation: Rebasing rewrites commit history, so if others are working on the same branch, it can cause conflicts and confusion.


Q12. Which one of the following statements is true?

Answer: A rebase may result in a merge conflict.

Explanation: During a rebase, conflicts may occur when the changes in the branch being rebased conflict with the base branch.


Q13. Which one of the following statements is true?

Answer: A rebase may rewrite the commit history.

Explanation: Rebasing can alter the commit history by reapplying commits on top of a different base commit, which changes their hashes.


Q14. Which one of the following statements is true?

Answer: A rebase may result in a merge conflict.

Explanation: Rebasing can cause merge conflicts if the changes in the branch being rebased conflict with the changes in the base branch.


Q15. Which one of the following statements is true?

Answer: An interactive rebase may involve a single branch.

E xplanation:An interactive rebase allows you to reorder, squash, or edit commits within a single branch, without involving multiple branches.

Version Control with Git Module 04 Assessment Answers

Q1. Which one of these is the main goal of a pull request?

Answer: Merge a branch into a project.

Explanation: The main purpose of a pull request is to request the merging of changes from one branch into another, typically from a feature branch into a main branch.


Q2. Which one of these statements is true?

Answer: A pull request can act as a form of review and approval.

Explanation: A pull request is often used to review code, discuss changes, and approve them before merging into the main project.


Q3. Which one of these statements is true?

Answer: Merging a pull request may result in a merge conflict.

Explanation: If changes made in the pull request conflict with changes already present in the branch being merged into, a merge conflict may occur.


Q4. Which one of these statements is true?

Answer: Pull requests can facilitate team discussion.

Explanation: Pull requests provide a platform for team members to discuss the changes, suggest improvements, and collaborate on code before merging.


Q5. When can you open a pull request?

Answer: When you want feedback on your work.

Explanation:You can open a pull request to get feedback from others, even if the branch is not yet fully ready to be merged.


Q6. Which one of these is true about squash merges?

Answer: A squash merge can result in deleted commits.

Explanation: A squash merge combines all the commits in a branch into a single commit, and the individual commits are lost in the process.


Q7. Which one of these statements is true?

Answer: A fork is a remote repository.

Explanation: A fork is essentially a remote copy of a repository, typically owned by a different user, used to make changes without affecting the original repository.


Q8. Which one of the statements about forks is true?

Answer: The upstream repository may have access to the fork.

Explanation: The upstream repository may have access to the fork if the fork’s owner contributes back to the upstream through pull requests.


Q9. After forking a repository, which one of these statements is true?

Answer: The commit histories of the two repositories may begin to differ.

Explanation: After forking, the commit histories of the two repositories can diverge as changes are made independently.


Q10. Which one of these statements is true?

Answer: Cloning a forked repository creates a local repository.

Explanation: When you clone a forked repository, you create a local copy of it, allowing you to work on it locally.


Q11. Assume that you have a forked repository and an upstream repository. Who selects the merge strategy if a pull request is merged?

Answer: The person merging the pull request.

Explanation: The person merging the pull request selects the merge strategy, which can be a merge commit, squash, or rebase.


Q12. Which one of these statements about centralized workflows is true?

Answer: There is usually a single branch on the remote repository.

Explanation: In centralized workflows, typically, there is a main branch in the remote repository, and everyone works on it.


Q13. Which one of these statements about feature branch workflows is true?

Answer: Most work is done on a feature branch.

Explanation: In a feature branch workflow, developers create separate branches for each feature or bug fix, and most of the work is done on those branches before merging.


Q14. Which one of these statements about forking workflows is true?

Answer: A forking workflow involves multiple remote repositories.

Explanation: In a forking workflow, each contributor forks the original repository, leading to multiple remote repositories.


Q15. Which one of these statements about Gitflow workflows is true?

Answer: Gitflow workflows can accommodate hotfixes.

Explanation: Gitflow workflows have a dedicated hotfix branch, which allows quick fixes to be applied and merged into the main branch, typically used in production environments.

Find More Related Quiz Answers >>

Data Science Methodology

Python for Data Science, AI & Development

Python Project for Data Science

Databases and SQL for Data Science with Python

Data Analysis with Python

Also Read About >> Getting Started – About Version Control

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *