




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Foundational certification covering Git version control basics: repositories, branching, merging, pull requests, and collaboration workflows on GitHub. Designed for developers and DevOps professionals.
Typology: Exams
1 / 170
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. What is the primary purpose of version control in software development? A) To speed up code execution B) To track and manage changes to code C) To compile code D) To debug code Answer: B Explanation: Version control tracks and manages changes to code, allowing teams to collaborate efficiently and maintain a history of modifications. Question 2. Which of the following initializes a new Git repository in your current directory? A) git create
B) git init C) git start D) git new Answer: B Explanation: The git init command initializes a new Git repository in the current directory. Question 3. What is the main function of the git clone command? A) Deletes a local repository B) Creates a local copy of a remote repository C) Merges two branches D) Displays the commit history Answer: B
A) Commits changes B) Deletes files C) Stages changes for the next commit D) Pulls changes from remote Answer: C Explanation: git add stages changes, preparing them to be committed to the repository. Question 6. What is the result of running git commit - m "message"? A) Pushes changes to GitHub B) Stages changes C) Saves staged changes with a message D) Pulls changes from a remote
Answer: C Explanation: git commit - m saves the staged changes as a new commit with a descriptive message. Question 7. Which Git command uploads local repository content to a remote repository? A) git fetch B) git push C) git clone D) git merge Answer: B Explanation: git push uploads local commits to a remote repository such as GitHub.
C) git branch D) git show Answer: B Explanation: git status displays which files are staged, unstaged, or untracked. Question 10. What is a repository in Git and GitHub? A) A place to run code B) A storage area for images C) A storage area for project files and their history D) A code compiler Answer: C
Explanation: A repository stores project files and their entire version history. Question 11. What is a branch in Git? A) A backup copy B) A separate line of development C) An error report D) A folder Answer: B Explanation: A branch is a parallel version of the repository, used for developing new features or fixes. Question 12. Which file is used to specify intentionally untracked files to ignore in a Git repository?
Answer: B Explanation: README.md typically provides an overview, usage, and documentation for the project. Question 14. What does the git log command display? A) Untracked files B) Commit history C) Branches D) Staged files Answer: B Explanation: git log shows the commit history of the current repository or branch.
Question 15. What is the default branch name in most new GitHub repositories (as of 2021)? A) master B) main C) dev D) trunk Answer: B Explanation: GitHub changed the default branch to main in 2021 for new repositories. Question 16. Which command is used to view all existing branches in a local repository? A) git log B) git branch
Question 18. What is the purpose of a pull request on GitHub? A) Create a new repository B) Request to merge code changes C) Delete a repository D) Roll back changes Answer: B Explanation: Pull requests are used to propose and discuss changes before merging them into the main codebase. Question 19. Which GitHub feature is best for tracking bugs and tasks? A) Pull Requests B) Issues
C) Forks D) Actions Answer: B Explanation: Issues are used to track bugs, tasks, and feature requests. Question 20. What is the result of forking a repository on GitHub? A) Deletes the original repo B) Creates a personal copy you can edit C) Merges two repositories D) Compiles code automatically Answer: B Explanation: Forking creates your own copy of someone else’s repository for making changes independently.
C) Deleting commits D) Adding files Answer: B Explanation: git merge combines the changes from one branch into the current branch. Question 23. What is the purpose of the .git directory in a project? A) Stores images B) Stores Git configuration and history C) Holds compiled files D) Caches web pages Answer: B
Explanation: The .git directory contains all the version control information for the repository. Question 24. What does git remote add origin
Answer: C Explanation: git fetch downloads new commits from the remote repository but does not merge them automatically. Question 27. What is the primary use of the git stash command? A) Deletes a branch B) Temporarily shelves changes C) Commits changes D) Merges branches Answer: B Explanation: git stash temporarily saves modified tracked files so you can work on something else and re-apply them later.
Question 28. Which of the following best describes a commit in Git? A) A backup copy B) A snapshot of staged changes C) A branch D) A tag Answer: B Explanation: Each commit is a snapshot of the changes staged at a certain point. Question 29. What is GitHub Desktop? A) A web browser B) A graphical interface for Git and GitHub C) A code editor