In managing open source projects with Git, the ________ file is crucial for describing project guidelines and contribution procedures.

  • README
  • LICENSE
  • CONTRIBUTING
  • CODEOWNERS
The CONTRIBUTING file in a Git repository is essential for providing guidelines on how developers can contribute to the project. It outlines coding standards, processes for submitting issues or pull requests, and other contribution-related information.

To automate the execution of tests every time a new commit is pushed, a _________ Git hook can be utilized.

  • Pre-receive
  • Post-receive
  • Update
  • Pre-commit
Git hooks are scripts that Git executes before or after events such as commit, push, and receive. The Post-receive hook is suitable for automated tasks after a successful push.

In a collaborative project using Git, what is the purpose of a pull request?

  • A pull request is a mechanism for contributors to propose changes to the main repository and request that someone review and merge their changes.
  • Pull requests are used to fetch changes from a remote repository.
  • Pull requests are only necessary in Forking workflow, not in Feature Branch workflow.
  • Pull requests are equivalent to merge requests and are used only for merging code.
Pull requests facilitate code review, discussion, and automated testing before changes are merged into the main branch, promoting collaboration and maintaining code quality.

What is the purpose of cherry-picking in Git?

  • Apply specific commits
  • Merge two branches
  • Revert changes
  • Delete a branch
Cherry-picking in Git allows you to select specific commits from one branch and apply them to another. This is useful when you only want certain changes from one branch without merging the entire branch.

In an open source project, a critical bug is discovered in a release. How should the maintainers use Git to address this issue promptly while maintaining the integrity of the project?

  • Cherry-pick
  • Revert
  • Reset
  • Squash
The maintainers should use the "Revert" option. Reverting creates a new commit that undoes the changes introduced by a specific commit, effectively addressing the critical bug while maintaining the integrity of the project history. It is a safer option than resetting or squashing, as it keeps a clear record of the fix without altering existing commits.

Customizing the __________ Hook can help enforce coding standards before code is pushed.

  • Pre-push
  • Pre-receive
  • Post-commit
  • Post-receive
The correct option is Pre-receive. This hook is executed on the server when you receive a push. Customizing it allows you to enforce coding standards before accepting the pushed code.

A developer wants to automate the deployment of their application to a server after each commit to the master branch on GitLab. Which Git feature should they utilize?

  • GitLab CI/CD
  • Git Submodules
  • Git Merge Requests
  • Git Stash
To automate the deployment process after each commit to the master branch on GitLab, the developer should utilize GitLab CI/CD (Continuous Integration/Continuous Deployment). GitLab CI/CD allows developers to define and automate pipelines for building, testing, and deploying their applications.

During a project audit, you need to find out when a specific bug was introduced. What Git feature can help you trace the origin of this bug?

  • blame
  • log
  • bisect
  • show
The correct option is bisect. The git bisect command allows you to perform a binary search through the commit history to identify when a bug was introduced. By marking good and bad commits, Git efficiently narrows down the faulty commit range.

A pull request is a request to merge a branch called _______ into another branch in a Git repository.

  • feature_branch
  • source_branch
  • target_branch
  • merge_branch
In a pull request, the branch to be merged is the target branch, where the changes will be applied.

After completing a significant feature, a developer wants to mark the current state of the repository for future reference. Which Git feature would be most appropriate?

  • Tag
  • Branch
  • Commit
  • Stash
The correct option is Tag. Tags in Git are used to mark specific points in history as being important. This is commonly done to capture a release point or mark a significant version in the repository. Unlike branches, tags are generally not moved once created.