What is the key difference between rebasing and merging in Git?

  • Rebasing maintains a linear project history by moving the entire branch to a new base commit.
  • Merging combines changes from different branches by creating a new commit with two parent commits.
  • Rebasing is only suitable for small, local branches.
  • Merging is a destructive operation that can lead to conflicts more often than rebasing.
In-depth Rebasing rewrites commit history, creating a cleaner and more straightforward timeline. Merging retains the commit history but may result in a more complex branch structure.

In complex projects, how can 'topic branches' be effectively utilized?

  • Facilitate parallel development
  • Improve code review process
  • Simplify version control
  • Enhance documentation management
In complex projects, 'topic branches' can be effectively utilized to facilitate parallel development. Each branch can focus on a specific feature or bug fix, allowing team members to work concurrently without interfering with the main codebase. This promotes a more efficient and organized development process.

How does the Git rebase operation affect the commit history?

  • It combines commits
  • It discards commits
  • It creates new commits
  • It modifies existing commits
Git rebase is used to integrate changes from one branch to another. It works by applying each commit from the source branch onto the target branch. This can result in a cleaner, more linear commit history as compared to git merge.

In Git, how can you recover a deleted branch that was not merged?

  • git branch -d branch_name
  • git checkout -b branch_name
  • git reflog
  • git branch branch_name commit_hash
To recover a deleted branch that was not merged, you can use git reflog to view the history, find the commit hash where the branch was deleted, and then recreate the branch using git branch branch_name commit_hash.

In a large repository, using git __________ can help in managing large files more effectively.

  • annex
  • filter
  • lfs
  • chunk
Git LFS (Large File Storage) is used to manage large files more effectively in a repository, preventing them from bloating the repository size.

In the case of a corrupted repository, what Git command can be used to verify the integrity of the repository?

  • git fsck
  • git verify
  • git check
  • git integrity
The correct command is git fsck, which stands for file system check. It checks the integrity of objects in the repository and can help identify and fix issues in a corrupted repository.

In database version control, the command git _______ helps in tracking schema changes.

  • diff
  • schema
  • track
  • history
The git diff command in the context of database version control helps in tracking changes to the schema, providing a clear view of modifications made over time.

How can you remove a file from a Git repository without deleting it from your file system?

  • git delete
  • git remove
  • git rm
  • git detach
The git rm command is used to remove a file from both the working directory and the staging area. However, when used with the --cached option, it only removes the file from the staging area, leaving the working directory and the file system unchanged. This is useful for untracking a file without deleting it.

Which Git command is used to view the status of files and potential conflicts after a merge attempt?

  • git log
  • git diff
  • git status
  • git merge --status
The Git command used to view the status of files and potential conflicts after a merge attempt is git status. This command provides information about modified, untracked, and conflicted files, allowing the user to understand the current state of the repository. git log shows the commit history, git diff displays the differences between commits, and git merge --status is not a valid command for checking the status after a merge attempt.

In a large project, the development team needs to rapidly prototype features while keeping the main branch stable. What Git approach would be most beneficial?

  • Git Forking
  • Git Revert
  • Git Cherry-Pick
  • Git Branching
Git Forking is a suitable approach for rapidly prototyping features in a large project while maintaining main branch stability. It allows developers to work on isolated copies (forks) of the main repository and propose changes through pull requests, ensuring a controlled integration process.