Understanding Version Control
Which of the following best describes Git?
- A free and open-source distributed version control system designed for tracking code changes.
- A cloud storage service for saving files online.
- A word processing software for drafting documents.
- A programming language for developing web applications.
- A database management system for organizing data.
Git's Core Language
Git is primarily written in which programming language, enabling its speed and efficiency?
- Python
- Java
- C
- Ruby
- CSS
Understanding Repositories
In Git, what is a repository (repo)?
- A location for storing code versions and their history.
- A folder that only contains backups of documents.
- A cloud server running test scripts.
- A collection of unrelated project files.
- A command used to search code.
Bare Repository Concept
What is true about a bare repository in Git?
- It contains only Git metadata and no working directory.
- It is a type of repository with extra features for beginners.
- It has only the files currently being worked on.
- It automatically merges new code from the internet.
- It is a temporary storage for secret files.
Purpose of 'git stash'
If a developer runs 'git stash', what happens to their uncommitted changes?
- The changes are deleted permanently.
- The changes are committed to the repository.
- The changes are saved temporarily without committing.
- The changes are merged with another branch.
- The changes are ignored by Git forever.
Managing Stashes
What does the command 'git stash drop' accomplish?
- It permanently adds a new stash entry.
- It removes the most recent stash entry from the list.
- It restores all stashed changes to the working directory.
- It commits all stashed files immediately.
- It changes the current branch to the stash branch.
Git Collaboration Basics
What is the main function of the 'git push' command?
- To pull new changes from a remote repository.
- To delete a file from the repository.
- To upload committed changes to a remote repository.
- To stash changes without committing.
- To merge two branches into one.
Branching Advantage
Why is branching considered important when using Git? For example, a team wants to build a new feature without changing the main code.
- It allows developers to work independently on different features.
- It only lets one developer work at a time.
- It copies the repository to another developer’s machine.
- It deletes unfinished work automatically.
- It saves backups to the cloud every hour.
Configuring User Information
Which command allows users to set their name and email for every commit made with Git?
- git commit
- git add
- git config
- git merge
- git rename
Staging Area Role
What is the function of the staging area (Index) in Git?
- A place to review and format changes before committing them.
- A backup server for deleted files.
- A folder that holds only images and documents.
- A temporary area for running programs.
- A tool for searching code for errors.