To undo changes made to your working directory, use the command git _______.
- reset
- revert
- restore
- rollback
The correct option is "b) revert." The git revert command is used to undo changes made in the working directory by creating a new commit that undoes the specified commit. This allows you to maintain a linear project history.
GitLab’s CI/CD pipelines can be configured through a file named _________.
- .gitlab-pipeline.yml
- .gitlab-ci.yml
- .gitlab-pipe.yml
- .gitlab-config.yml
The .gitlab-ci.yml file is used to define CI/CD pipelines in GitLab. It specifies the steps and actions to be taken during the pipeline execution, such as building, testing, and deploying.
To handle large files during a Git transition, the use of git _______ can be a solution.
- annex
- bigfile
- lfs
- compress
The correct option is 'lfs.' In Git, Large File Storage (LFS) is a system designed to handle large files efficiently. By using the 'git lfs' command, large files can be managed separately, preventing them from bloating the repository and slowing down the version control system.
How does Git enable version control for database schema changes?
- By creating separate branches for each database schema version.
- By using Git hooks to automate schema change tracking.
- By committing SQL scripts along with code changes.
- By leveraging Git tags for database schema versions.
Git helps in version controlling database schema changes by allowing developers to commit SQL scripts along with their code changes. This ensures that changes to the database schema are tracked and can be reverted if necessary.
To maintain code quality, a __________ hook in Git can be used to run tests before each commit.
- Pre-commit
- Post-commit
- Pre-push
- Post-receive
In Git, a pre-commit hook is used to execute actions, such as running tests, before a commit is made. This ensures that the code complies with quality standards before being committed.
How does Git enable better handling of changes and revisions in large-scale projects?
- Distributed version control
- Enhanced branching and merging capabilities
- Efficient handling of complex projects
- Improved commit tracking
Git facilitates better handling of changes in large-scale projects by efficiently handling complex projects, providing enhanced branching and merging capabilities, and offering distributed version control.
In complex projects, integrating Git with IDEs enables _________ tracking for each branch.
- Issue
- Bug
- Ticket
- Task
Integrating Git with IDEs enables automated ticket tracking for each branch in complex projects. This integration helps in associating code changes with specific tasks or issues, providing a clear history of the development process and making it easier to manage project complexity.
If you need to review the history of changes within a specific file, use git _______ .
- log
- status
- show
- diff
The correct option is show. The git show command displays the content and changes of a specified commit or file. It is particularly useful for reviewing the history of changes within a specific file.
How can GPG (GNU Privacy Guard) be used in the context of Git?
- Sign commits with GPG
- Encrypt sensitive files
- Create Git tags
- Enable Git history tracking
GPG (GNU Privacy Guard) in Git is used to sign commits, providing a verifiable way to confirm the author's identity and the integrity of the code. This enhances security and trust in the Git repository.
What is the significance of signing tags in Git?
- It ensures the tag is visible in the Git log.
- It verifies the authenticity and integrity of the tag using GPG signatures.
- It compresses the tagged files to save space.
- It prevents the tag from being deleted accidentally.
Signing tags in Git involves using GPG signatures to verify the authenticity and integrity of the tag. This adds a layer of security, ensuring that the tag was created by a trusted person and hasn't been tampered with. It helps in establishing the authenticity of releases, making it more reliable for users to trust the tagged versions.