Initializing a Repository
What is the correct command to initialize a new Git repository in the current directory?
- A: git start
- B: git init
- C: git new
- D: git begin
- E: git initialize
Staging Changes
Which command stages all modified files in the working directory for the next commit?
- A: git commit -a
- B: git add .
- C: git stage all
- D: git push all
- E: git commit -am
Creating a Branch
What is the command used to create a new branch named 'feature-x'?
- A: git branch feature-x
- B: git checkout -b feature-x
- C: git new-branch feature-x
- D: git create branch feature-x
- E: git branch --new feature-x
Switching Branches
How do you switch to the 'development' branch?
- A: git switch development
- B: git checkout development
- C: git branch development
- D: git change development
- E: git use development
Merging Branches
Assuming you are on the 'main' branch, what command merges the 'feature-y' branch into 'main'?
- A: git merge main feature-y
- B: git merge feature-y
- C: git checkout feature-y u0026u0026 git merge main
- D: git merge into main feature-y
- E: git merge feature-y main
Resolving Conflicts
After encountering a merge conflict, what is the typical first step to resolve it?
- A: Run git commit --amend
- B: Manually edit the conflicting files to resolve the issues
- C: Use git revert
- D: Delete the conflicting branch
- E: Run git clean -f
Cloning a Repository
What command is used to download a remote repository to your local machine?
- A: git pull
- B: git fetch
- C: git clone
- D: git download
- E: git get
Pushing Changes
What command sends your local commits to a remote repository?
- A: git send
- B: git sync
- C: git commit
- D: git push
- E: git upload
Reverting a Commit
Which command creates a new commit that undoes the changes introduced by a specific commit?
- A: git undo
- B: git reset
- C: git revert
- D: git checkout -- .
- E: git remove
Gitignore Files
What is the primary purpose of a '.gitignore' file?
- A: To specify files to be committed to the repository.
- B: To specify files to be ignored by Git, preventing them from being tracked.
- C: To define user preferences for the Git environment.
- D: To store configuration settings for the repository.
- E: To track the history of ignored files.