introduction to git and github week 4

Practice Quiz: Pull Requests

1. What is the difference between using squash and fixup when rebasing?

  • Squash deletes previous commits.
  • Squash combines the commit messages into one. Fixup discards the new commit message.
  • Squash only works on Apple operating systems.
  • Fixup combines the commit messages into one. Squash discards the commit message.

2. What is a pull request?

  • The owner of the target repository requesting you to add your changes.
  • A request sent to the owner and collaborators of the target repository to pull your recent changes.
  • A request to delete previous changes.
  • A request for a specific feature in the next version.

3. Under what circumstances is a new fork created?

  • When you want to experiment with changes without affecting the main repository.
  • When you clone a remote repository to your local machine.
  • During a merge conflict.
  • When there are too many branches.

4. What combination of command and flags will force Git to push the current snapshot to the repo as it is, possibly resulting in permanent data loss?

  • git push -f
  • git log –graph –oneline –all
  • git status
  • git rebase -i

5. When using interactive rebase, which option is the default, and takes the commits and rebases them against the branch we selected?

  • squash
  • edit
  • reword
  • pick

6. When should we respond to comments from collaborators and reviewers?

  • When their comments address software-breaking bugs
  • No need, just resolve the concerns and be done with it
  • Always
  • Only when a code correction is necessary

7. What is a nit?

  • A trivial comment or suggestion
  • A couple lines of code
  • A repository that is no longer maintained
  • An orphaned branch

8. Select common code issues that might be addressed in a code review. (Check all that apply)

  • Using unclear names
  • Following PEP8 guidelines
  • Forgetting to handle a specific condition
  • Forgetting to add tests

9. If we've pushed a new version since we've made a recent change, what might our comment be flagged as?

  • Accepted
  • Resolved
  • Outdated
  • Merged

10. What are the goals of code review? (Check all that apply)

  • Make sure that the contents are easy to understand
  • Ensure consistent style
  • Build perfect code
  • Ensure we don’t forget any important cases

11. How do we reference issues in our commits with automatic links?

  • By using one of the keywords followed by a hashtag and the issue number.
  • By using an asterisk (*) after the issue number.
  • By typing the issue number inside braces ({}).
  • By using a special keyword.

12. What is an artifact in terms of continuous integration/continuous delivery (CI/CD) pipelines?

  • An old and obsolete piece of code or library.
  • Any file generated as part of the CI/CD pipeline.
  • An unintended minor glitch in a computer program
  • An automated series of tests that run each time there is a new commit or pull request.

13. Which of the following statements are good advice for project maintainers? (Check all that apply)

  • Coordinate solely via email
  • Reply promptly to pull-requests
  • Understand any changes you accept
  • Use an issue tracker

14. Which statement best represents what a Continuous Integration system will do?

  • Run tests automatically
  • Update with incremental rollouts
  • Assign issues and track who’s doing what
  • Specify the steps that need to run to get the result you want

15. Which statement best represents what a Continuous Delivery (CD) system will do?

  • Run tests automatically
  • Update with incremental rollouts
  • Assign issues and track who’s doing what
  • Specify the steps that need to run to get the result you want

Leave a Reply