git
- Version Control
What is Git and why is it widely used?
Git is a distributed version control system that tracks changes and enables collaboration among developers.
Explain the difference between git pull and git fetch.
git fetch downloads changes without merging, while git pull downloads and merges changes into the current branch.
What are branches in Git and how are they used?
Branches are independent lines of development used to work on features or fixes without affecting the main codebase.
How do you resolve merge conflicts in Git?
Merge conflicts occur when changes overlap; they are resolved by manually editing conflicting files and committing...
What is the purpose of the .gitignore file?
.gitignore specifies files and directories that Git should ignore and not track.
Explain the staging area in Git.
The staging area holds changes that will be included in the next commit.
What is a detached HEAD state in Git?
It occurs when HEAD points to a commit rather than a branch, leading to commits not associated with any branch.
How does Git handle version history?
Git stores snapshots of the entire repository at each commit, allowing efficient history tracking and branching.
What are tags in Git and how are they used?
Tags mark specific points in history, often used for releases.
What is rebasing and how does it differ from merging?
Rebasing moves or combines commits onto a new base commit, rewriting history, unlike merging which creates a merge commit.
Version Control
What is Git and why is it widely used?
Git is a distributed version control system that tracks changes and enables collaboration among developers.
Explain the difference between git pull and git fetch.
git fetch downloads changes without merging, while git pull downloads and merges changes into the current branch.
What are branches in Git and how are they used?
Branches are independent lines of development used to work on features or fixes without affecting the main codebase.
How do you resolve merge conflicts in Git?
Merge conflicts occur when changes overlap; they are resolved by manually editing conflicting files and committing the result.
What is the purpose of the .gitignore file?
.gitignore specifies files and directories that Git should ignore and not track.
Explain the staging area in Git.
The staging area holds changes that will be included in the next commit.
What is a detached HEAD state in Git?
It occurs when HEAD points to a commit rather than a branch, leading to commits not associated with any branch.
How does Git handle version history?
Git stores snapshots of the entire repository at each commit, allowing efficient history tracking and branching.
What are tags in Git and how are they used?
Tags mark specific points in history, often used for releases.
What is rebasing and how does it differ from merging?
Rebasing moves or combines commits onto a new base commit, rewriting history, unlike merging which creates a merge commit.