Note: This is LLM-generated, tread with caution!
-
What is a Git Repository (Repo)?
- A central location where all your project's files, history, and metadata are stored.
- A specific version of your project's files.
- A tool for finding the commit that introduced a bug.
-
What is the purpose of a Commit in Git?
- To track changes and identify who made modifications.
- To upload local changes to a remote repository.
- Both A and B.
-
What is a Branch in Git?
- An independent line of development in your repository, allowing parallel work without disrupting the main project.
- A copy of your repository hosted on an external server.
- A specific version of your project's files.
-
What does a Remote Repository enable?
- Collaboration, backup, and additional features like issue tracking and pull requests.
- Temporary saving of unresolved changes.
- Integration of changes from various sources, ensuring the repository remains up-to-date.
-
What is the difference between Git Reset and Git Revert?
- Git Reset updates the current branch to a specified commit, while Git Revert creates a new commit that undoes changes from a previous commit.
- Git Reset potentially discards changes, while Git Revert preserves the commit history.
- Git Reset is used for temporary changes, while Git Revert is used for permanent changes.
-
What is Git Stash used for?
- To track changes and identify who made modifications.
- To temporarily save unresolved changes, allowing you to switch branches or work on other tasks without committing incomplete work.
- To mark releases, versions, or milestones in your project.
-
What is a Pull Request (PR) in Git?
- A proposed change to a repository, submitted for review and approval by others.
- A way to integrate changes from different branches or collaborators.
- A bookmark for a specific commit, often used to mark releases, versions, or milestones.
-
How does Git LFS (Large File Storage) help in managing large files?
- By reducing repository size, improving performance, and simplifying collaboration.
- By enabling modular dependencies and external collaborations.
- By enforcing coding standards and automating testing.
-
What is the purpose of Git Hooks?
- To manage large files in Git repositories.
- To enforce coding standards, automate testing, and enhance the development workflow.
- To integrate specific changes and maintain a clean history.
-
What is Git Rebase used for?
- To manage large files in Git repositories.
- To temporarily save unresolved changes.
- To maintain a clean, linear commit history and simplify conflict resolution.
-
What is the purpose of Git Ignore (.gitignore)?
- To specify files or directories that Git should ignore in a repository.
- To keep unwanted files out of your repository, reducing clutter and maintaining focus on relevant code.
- To resolve conflicts that occur when merging changes.
-
Why are Pull Requests used in Git?
- To facilitate collaborative development, code review, and quality control.
- To mark releases, versions, or milestones in your project.
- To resolve conflicts that occur when merging changes.
-
What is the purpose of Git Stash?
- To track changes and identify who made modifications.
- To temporarily save unresolved changes, allowing you to switch branches or work on other tasks without committing unfinished work.
- To mark releases, versions, or milestones in your project.
-
What are the two main types of Git commits?
- Committing staged changes and committing workspace changes.
- Committing local changes and pushing to remote changes.
- Committing on the feature branch and committing on the main branch.
-
When should Pull Requests be used in the Git workflow?
- After pushing a new feature branch to the remote repository, to facilitate code review.
- Before making any local changes to your repository.
- Only when merge conflicts occur.
-
What is the first step when starting work on a new feature in Git?
- Commit directly to the main branch.
- Create a new branch for the feature.
- Submit a Pull Request.
-
What happens after a Pull Request is approved and merged?
- The changes from the feature branch are integrated into the main branch.
- The feature branch is automatically deleted.
- A new release tag is created.
-
When should you use "git reset" versus "git revert"?
- Use "git reset" to undo commits that have not yet been pushed and "git revert" to undo commits that have already been shared.
- Use "git reset" for undoing commits in your local history and "git revert" for undoing changes from a previous commit while preserving the commit history.
- Use "git reset" to resolve merge conflicts and "git revert" to create pull requests.