Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Git and github quiz

Quiz git and github

Uploaded by

priyajenat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Git and github quiz

Quiz git and github

Uploaded by

priyajenat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Value-Added Course

Quiz questions

1. What is the primary purpose of Git?

a) Project management

b) Version control

c) Code execution

d) Cloud storage

Answer: b) Version control

2. Which command initializes a new Git repository?

a) git init

b) git start

c) git create

d) git repo

Answer: a) git init

3. What does the git status command do?

a) Shows the commit history

b) Displays the current branch name and changes

c) Pushes changes to the remote repository

d) Stages files for commit

Answer: b) Displays the current branch name and changes

4. Which of the following files is used to exclude specific files from being tracked in Git?

a) .exclude
b) .gitignore

c) .gitconfig

d) .tracker

Answer: b) .gitignore

5. What is the default branch name in a new Git repository?

a) main

b) master

c) default

d) primary

Answer: a) main

6. Which command is used to commit changes in Git?

a) git save

b) git update

c) git commit

d) git push

Answer: c) git commit

7. What does the git clone command do?

a) Creates a backup of a repository

b) Downloads a copy of a remote repository

c) Merges changes from another branch

d) Resolves conflicts in the repository

Answer: b) Downloads a copy of a remote repository


8. What is a branch in Git?

a) A type of file in a repository

b) A pointer to a specific commit

c) A way to organize different repositories

d) A command for merging repositories

Answer: b) A pointer to a specific commit

9. Which command shows the commit history?

a) git log

b) git history

c) git commits

d) git track

Answer: a) git log

10. What does the git merge command do?

a) Combines changes from one branch into another

b) Deletes a branch

c) Creates a new branch

d) Pushes changes to the remote repository

Answer: a) Combines changes from one branch into another

11. What happens if you try to push changes without committing them first?

a) The changes are pushed automatically

b) An error message is displayed

c) The repository is overwritten


d) A new branch is created

Answer: b) An error message is displayed

12. How do you resolve a merge conflict in Git?

a) Delete the repository and start over

b) Use the git resolve command

c) Edit the conflicting files manually and commit the changes

d) Run the git clean command

Answer: c) Edit the conflicting files manually and commit the changes

Chapter 2: Collaborative Development and Project Management (Multiple Choice Questions)

13. Which GitHub feature allows team members to suggest changes to a repository?

a) Issues

b) Pull Requests

c) Commits

d) Actions

Answer: b) Pull Requests

14. What is the purpose of code review in collaboration?

a) To merge branches automatically

b) To ensure code quality and catch errors

c) To generate documentation

d) To delete unnecessary branches

Answer: b) To ensure code quality and catch errors


15. Which tool in GitHub helps organize and track project progress?

a) GitHub Pages

b) GitHub Actions

c) GitHub Projects

d) GitHub Desktop

Answer: c) GitHub Projects

16. What syntax is used for formatting documentation in Markdown?

a) HTML tags

b) YAML syntax

c) Plain text only

d) Special symbols like #, *, and []

Answer: d) Special symbols like #, *, and []

17. What is the purpose of forking a repository?

a) To create a duplicate repository for personal use

b) To delete a repository

c) To merge branches

d) To perform a code review

Answer: a) To create a duplicate repository for personal use

18. How do you start a new discussion about a bug in GitHub?

a) Open a pull request

b) Create an issue

c) Add a branch
d) Submit a merge request

Answer: b) Create an issue

19. What is the primary role of a README file in a GitHub repository?

a) Tracks bugs in the project

b) Provides an overview of the project

c) Creates branches automatically

d) Executes CI/CD pipelines

Answer: b) Provides an overview of the project

20. What is the default status of a pull request when created?

a) Approved

b) Pending review

c) Rejected

d) Merged

Answer: b) Pending review

21. Which of the following is true about GitHub Issues?

a) They are used to manage project discussions and track tasks.

b) They store the repository’s commit history.

c) They are used to create new branches.

d) They automatically resolve conflicts.

Answer: a) They are used to manage project discussions and track tasks.

22. What GitHub feature allows you to automate tracking of project tasks?
a) GitHub Pages

b) GitHub Boards

c) GitHub Projects

d) GitHub Forks

Answer: c) GitHub Projects

23. What is the primary benefit of open-source collaboration?

a) Proprietary development

b) Limited access to repositories

c) Global contribution and community support

d) No documentation requirements

Answer: c) Global contribution and community support

24. Which command is commonly used to pull the latest changes from the remote repository?

a) git pull

b) git push

c) git fetch

d) git sync

Answer: a) git pull

25. What is GitHub Actions used for?

a) Deploying repositories directly

b) Automating workflows, CI/CD, and testing

c) Merging branches

d) Reviewing pull requests


Answer: b) Automating workflows, CI/CD, and testing

26. What are workflows in GitHub Actions defined by?

a) JSON files

b) YAML files

c) XML files

d) Plain text files

Answer: b) YAML files

27. What is a primary feature of Continuous Integration (CI)?

a) Automatically testing and building code changes

b) Deploying code to production servers

c) Merging pull requests

d) Generating documentation

Answer: a) Automatically testing and building code changes

28. Which of these is NOT a component of GitHub Actions?

a) Jobs

b) Actions

c) Workflows

d) Repositories

Answer: d) Repositories

29. What does the on key in a GitHub Actions YAML file specify?

a) The repository to execute the workflow in


b) The events that trigger the workflow

c) The schedule for CI/CD jobs

d) The secrets used in deployment

Answer: b) The events that trigger the workflow

30. What is a secret in GitHub Actions?

a) A private variable used for secure information

b) A hidden branch in the repository

c) An encrypted commit

d) A restricted repository feature

Answer: a) A private variable used for secure information

31. What is the key purpose of Continuous Deployment (CD)?

a) Merging branches automatically

b) Deploying code changes to production environments

c) Running unit tests on code changes

d) Creating pull requests

Answer: b) Deploying code changes to production environments

32. Which command can trigger GitHub Actions workflows locally for testing?

a) act

b) test

c) run-actions

d) ci-test

Answer: a) act
33. How are jobs executed in GitHub Actions?

a) In parallel by default

b) Sequentially by default

c) Randomly

d) Based on manual triggers

Answer: a) In parallel by default

34. What is an advantage of using reusable workflows in GitHub Actions?

a) Easier job dependencies management

b) Simplifies managing secrets

c) Reduces code duplication across repositories

d) Automatically merges branches

Answer: c) Reduces code duplication across repositories

35. What does the runs-on key in a workflow file define?

a) The events to trigger the workflow

b) The type of runner or environment for the job

c) The name of the workflow

d) The repository settings

Answer: b) The type of runner or environment for the job

36. Which GitHub feature allows you to test pull requests before merging?

a) GitHub Projects

b) GitHub Pages
c) GitHub Actions

d) GitHub Security

Answer: c) GitHub Actions

37.. Which GitHub feature allows team members to suggest changes to a repository?

a) Issues

b) Pull Requests

c) Commits

d) Actions

Answer: b) Pull Requests

38. What is the purpose of code review in collaboration?

a) To merge branches automatically

b) To ensure code quality and catch errors

c) To generate documentation

d) To delete unnecessary branches

Answer: b) To ensure code quality and catch errors

39. Which tool in GitHub helps organize and track project progress?

a) GitHub Pages

b) GitHub Actions

c) GitHub Projects

d) GitHub Desktop

Answer: c) GitHub Projects

40. What syntax is used for formatting documentation in Markdown?


a) HTML tags

b) YAML syntax

c) Plain text only

d) Special symbols like #, *, and []

Answer: d) Special symbols like #, *, and []

41. What is the purpose of forking a repository?

a) To create a duplicate repository for personal use

b) To delete a repository

c) To merge branches

d) To perform a code review

Answer: a) To create a duplicate repository for personal use

42. How do you start a new discussion about a bug in GitHub?

a) Open a pull request

b) Create an issue

c) Add a branch

d) Submit a merge request

Answer: b) Create an issue

43. What is the primary role of a README file in a GitHub repository?

a) Tracks bugs in the project

b) Provides an overview of the project

c) Creates branches automatically

d) Executes CI/CD pipelines


Answer: b) Provides an overview of the project

44. What is the default status of a pull request when created?

a) Approved

b) Pending review

c) Rejected

d) Merged

Answer: b) Pending review

45. Which of the following is true about GitHub Issues?

a) They are used to manage project discussions and track tasks.

b) They store the repository’s commit history.

c) They are used to create new branches.

d) They automatically resolve conflicts.

Answer: a) They are used to manage project discussions and track tasks.

46. What GitHub feature allows you to automate tracking of project tasks?

a) GitHub Pages

b) GitHub Boards

c) GitHub Projects

d) GitHub Forks

Answer: c) GitHub Projects

47. What is the primary benefit of open-source collaboration?

a) Proprietary development
b) Limited access to repositories

c) Global contribution and community support

d) No documentation requirements

Answer: c) Global contribution and community support

48. Which command is commonly used to pull the latest changes from the remote repository?

a) git pull

b) git push

c) git fetch

d) git sync

Answer: a) git pull

49. Which GitHub feature helps in detecting vulnerabilities in your code?

a) GitHub Issues

b) GitHub Security Alerts

c) GitHub Actions

d) GitHub Projects

Answer: b) GitHub Security Alerts

50. What is the purpose of a signed commit in Git?

a) To make the commit message visible to all users

b) To verify the author's identity for the commit

c) To automatically merge branches

d) To track file changes

Answer: b) To verify the author's identity for the commit


51. Which command is used to undo the last commit without losing changes?

a) git revert

b) git reset --soft HEAD~1

c) git checkout

d) git stash

Answer: b) git reset --soft HEAD~1

52. What is a best practice for managing sensitive information in a Git repository?

a) Store sensitive data in .gitignore files

b) Store sensitive data directly in commits

c) Use environment variables or GitHub Secrets

d) Encrypt sensitive data in plain text

Answer: c) Use environment variables or GitHub Secrets

53. What does the git bisect command help you do?

a) Compare two branches

b) Find the commit that introduced a bug

c) Merge changes from multiple contributors

d) Revert multiple commits

Answer: b) Find the commit that introduced a bug

54. What is the purpose of the git fsck command?

a) Fix conflicts during a merge

b) Verify the integrity of the repository


c) Delete large files from the repository

d) Clone a repository

Answer: b) Verify the integrity of the repository

55. Which command is used to permanently remove a file from Git history?

a) git remove

b) git rm --cached

c) git filter-branch

d) git stash

Answer: c) git filter-branch

56. What should you use to manage large files in a Git repository?

a) GitHub Pages

b) Git Large File Storage (Git LFS)

c) Git Submodules

d) GitHub Actions

Answer: b) Git Large File Storage (Git LFS)

57. What does the git reflog command display?

a) A log of all branches in the repository

b) A history of references and changes to the HEAD

c) The details of merge conflicts

d) The status of a repository

Answer: b) A history of references and changes to the HEAD


58. How can you encrypt files in a GitHub repository for security purposes?

a) Use .gitignore

b) Use GitHub Pages

c) Use GitHub Secrets or third-party tools like GPG

d) Store them in a separate branch

Answer: c) Use GitHub Secrets or third-party tools like GPG

59. What is the purpose of the git stash command?

a) Save uncommitted changes temporarily

b) Delete a branch

c) Merge changes into the main branch

d) Push commits to the remote repository

Answer: a) Save uncommitted changes temporarily

60. Which command is used to recover a deleted branch?

a) git reset

b) git checkout

c) git reflog

d) git pull

Answer: c) git reflog

1. What is the primary purpose of integrating GitHub with development tools like VS Code?

a) To automate workflows
b) To streamline code writing and repository management

c) To enhance repository security

d) To manage team members

Answer: b) To streamline code writing and repository management

2. Which platform can be used to showcase your coding projects professionally?

a) GitHub Pages

b) GitHub Issues

c) GitHub Actions

d) GitHub Security Alerts

Answer: a) GitHub Pages

3. What is the advantage of third-party integrations with GitHub?

a) Increase the repository size

b) Automate workflows and enhance functionality

c) Lock the repository

d) Delete branches automatically

Answer: b) Automate workflows and enhance functionality

4. Which GitHub feature can help you stay engaged with the open-source community?

a) GitHub Actions

b) GitHub Discussions
c) GitHub Pages

d) GitHub Security Alerts

Answer: b) GitHub Discussions

5. How can you continuously improve your Git skills?

a) By attending webinars and contributing to open-source projects

b) By deleting branches regularly

c) By using Git for proprietary projects only

d) By avoiding collaboration with others

Answer: a) By attending webinars and contributing to open-source projects

6. Which command integrates your Git repository with a CI/CD tool?

a) git link

b) git remote add

c) It depends on the CI/CD tool configuration

d) git ci

Answer: c) It depends on the CI/CD tool configuration

7. Which GitHub feature is useful for networking and showcasing work to potential employers?

a) GitHub Actions

b) GitHub Portfolio

c) GitHub Issues
d) GitHub Projects

Answer: b) GitHub Portfolio

8. What is an effective way to stay updated with changes in Git and GitHub?

a) Following GitHub’s official blog and release notes

b) Only using the git init command

c) Avoiding new updates to maintain stability

d) Limiting usage to a single repository

Answer: a) Following GitHub’s official blog and release notes

9. Which of these is a benefit of creating a GitHub portfolio?

a) It helps organize projects privately.

b) It showcases coding skills and projects to the public.

c) It limits collaboration opportunities.

d) It replaces the need for resumes.

Answer: b) It showcases coding skills and projects to the public.

10. What is GitHub Copilot used for?

a) Running CI/CD workflows

b) Assisting with code suggestions and automation

c) Monitoring repository security

d) Resolving merge conflicts automatically


Answer: b) Assisting with code suggestions and automation

11. Which feature in GitHub helps track contributions to multiple repositories?

a) GitHub Dashboard

b) Contributions Graph

c) Repository Insights

d) GitHub Projects

Answer: b) Contributions Graph

12. Why is networking through GitHub beneficial?

a) It ensures private collaboration only.

b) It allows visibility, feedback, and opportunities for contributions.

c) It limits the sharing of code.

d) It disables access to public repositories.

Answer: b) It allows visibility, feedback, and opportunities for contributions.

You might also like