Skip to content

Latest commit

 

History

History
91 lines (73 loc) · 4.87 KB

Q&A.md

File metadata and controls

91 lines (73 loc) · 4.87 KB

Note: This is LLM-generated, tread with caution!

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. 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.