In the Gitflow workflow, the ________ branch contains the official release history.
- Master
- Develop
- Release
- Hotfix
In Gitflow, the "Release" branch contains the official release history, and it is where code freezes in preparation for a new release. This branch helps manage versioning effectively.
Which Git Hook is triggered before a commit is finalized?
- pre-commit
- post-commit
- pre-receive
- post-receive
The pre-commit hook is triggered before a commit is finalized. It allows you to inspect the changes that are about to be committed and optionally abort the commit. This hook is useful for tasks like code formatting or running pre-commit tests.
How does Git support Agile development principles like collaboration and flexibility?
- Through its branching and merging capabilities
- By enforcing a strict development process
- By limiting the number of developers in a project
- By providing a centralized code repository
Agile Development with Git
How can branching strategies in Git enhance build automation processes?
- By using feature branches
- By adopting a GitFlow workflow
- By creating release branches
- By following a linear development approach
In Git, branching strategies like GitFlow can enhance build automation by providing a structured approach to managing feature development, releases, and hotfixes. GitFlow specifically defines branches such as feature branches for new features and release branches for stable releases, streamlining the build process.
If a branch history is corrupted, one can use git _______ to recreate commits from the reflog.
- git restore
- git reflog
- git recover
- git recreate
The correct option is git reflog. This command is used to access the Git reflog and can be helpful in recovering from a corrupted branch history by allowing the recreation of commits from the reflog.
To maintain a clean Git history when transitioning, it's recommended to use git ________ for combining multiple commits.
- squash
- merge
- amend
- rebase
git rebase is commonly used for combining multiple commits into a more logical and cleaner history. It helps in presenting a linear and organized history in the project log.
Your project has a dependency on a large external library. What Git feature would be most efficient to manage this dependency?
- Submodules
- Branching
- Forking
- Merging
Git Submodules allow the team to include and manage external repositories within their own project. It's an efficient way to handle dependencies without including all the external code directly into the main repository.
How does GitHub Actions integrate with Git workflows for CI/CD?
- Triggered by events in the repository
- Automated code deployment
- Version control system
- Code review process
GitHub Actions are triggered by events such as pushes to the repository. It is commonly used for automating CI/CD pipelines, which includes tasks like running tests and deploying code. Understanding these integrations is crucial for efficient CI/CD processes in a Git-based workflow.
What is the recommended approach to resolving complex merge conflicts in a collaborative project?
- Manual editing of files
- git merge --abort
- Automatic merging
- git mergetool
The recommended approach is manual editing of files. This allows developers to carefully review and choose how to merge conflicting changes, ensuring a more accurate and context-aware resolution.
Which Git feature is essential for managing large-scale projects in an enterprise environment?
- Git Submodules
- Git Hooks
- Git LFS (Large File Storage)
- Git Stash
Git LFS is crucial for managing large-scale projects in an enterprise environment. It allows efficient handling of large binary files by storing them outside the regular Git repository, preventing repository bloat and improving performance.