NEW
Font size
WorksheetsCh.3 Git and GitHub Quiz
Total questions: 30
Worksheet time: 10mins
What is the primary purpose of version control in software engineering?
To manage project budgets
To track changes in source code and applications
To design user interfaces
To compile code into executables
Who developed Git and for what project?
Bill Gates for Microsoft Windows
Linus Torvalds for the Linux kernel project
Steve Jobs for Apple macOS
Mark Zuckerberg for Facebook
In Git, what command is used to configure the user's name globally?
git set user.name
git config --global user.name
git user --name
git identity set name
Which of the following is NOT a type of version control system mentioned in the document?
Local Version Control Systems
Centralized Version Control Systems
Distributed Version Control Systems
Cloud-based Version Control Systems
What is the command to check the status of your Git repository?
git commit
git add
git status
git log
What does 'commit' represent in Git workflow?
Pushing changes to a remote repository
Saving changes to the local repository with a message
Creating a new branch
Merging two branches
Which Git command is used to create a new branch?
git new-branch
git branch {new branch name}
git checkout -b {new branch name}
git make branch
What is the purpose of 'git push' command?
To download changes from a remote repository
To upload local repository changes to a remote repository
To stage changes for commit
To view commit history
What is the command to download a repository from GitHub to your local machine?
git download
git get
git clone
git fetch
What is the 'Staging Area' in Git also known as?
Working Directory
Remote Repository
Index
.git directory
What is the main branch in Git often called, which stores the final version?
Development branch
Feature branch
Master/Main branch
Release branch
Which command is used to initialize a new Git repository in the current directory?
git start
git new
git init
git create
What does the command `git add .` do?
Commits all changes to the repository
Stages all new and modified files for the next commit
Deletes all untracked files
Pushes all changes to the remote repository
Before pushing changes to a remote repository, what command is typically used after `git add`?
git pull
git clone
git commit
git status
What is GitHub primarily used for?
Local file storage
Version control collaboration and backup
Image editing
Video streaming
What is a 'fork' in GitHub terminology?
A direct copy of a repository to your local machine
A personal copy of another user's repository that lives on your GitHub account
A way to merge changes from one branch to another
A command to undo the last commit
What is the purpose of a 'pull request' in GitHub?
To directly merge changes into the main branch
To request changes from a remote repository
To propose changes and ask others to review and merge them
To delete a branch from the repository
Which command is used to download changes from a remote repository to your local branch?
git push
git add
git commit
git pull
What is the difference between `git pull` and `git fetch`?
`git pull` only downloads changes, `git fetch` downloads and merges
`git fetch` only downloads changes, `git pull` downloads and merges
`git pull` is for local repositories, `git fetch` is for remote
There is no difference, they are interchangeable
What is the working directory in Git?
The hidden `.git` folder
The area where you modify files
The staging area
The remote repository
What command would you use to see the history of commits?
git status
git log
git diff
git show
What is a 'Personal Access Token' used for in GitHub?
To change your GitHub password
To authenticate Git operations without exposing your password
To share your repository with others
To delete your GitHub account
When working alone, after making changes to a cloned repository, what is the typical sequence of Git commands to update the remote repository?
git commit, git add, git push
git add, git commit, git push
git push, git add, git commit
git clone, git add, git commit
What is the primary benefit of using a Distributed Version Control System (DVCS) like Git?
It relies on a central server for all operations
Each developer has a full copy of the repository history
It is simpler to set up than other VCS types
It only tracks changes made by a single user
What does `git merge` do?
Undoes the last commit
Combines changes from different branches into one
Deletes a branch
Renames a branch
What is the command to view the content of a file in the shell?
ls
cd
cat
mkdir
What is the purpose of `git checkout`?
To record changes to the repository
To switch between branches or restore working tree files
To send changes to the remote repository
To download a repository
In the context of GitHub collaboration, if Daniel designates Peter as a collaborator, what can Peter then do?
Only view Daniel's repository
Push directly to Daniel's repository
Only fork Daniel's repository
Request changes from Daniel
If you run the following command:
" tar -czf backup.tar.gz --exclude='*.log' /var/www "
What will happen?
Creates a gzipped tarball of /var/www, excluding all .log files.
Creates a tarball of only .log files in /var/www.
Deletes .log files before creating the tarball.
Creates a tarball but ignores the compression step.
What is the significance of the `.git` directory within a repository?
It stores the actual project files
It contains all the metadata and object database for the repository
It is the staging area for changes
It is where the remote repository is located
