WorksheetsGit Commands Quiz
Total questions: 15
Worksheet time: 11mins
What is Git primarily used for?
Web Development
Version Control
Database Management
Graphic Design
Which command is used to initialize a new Git repository?
git start
git init
git create
git new
What does the 'git clone' command do?
Create a new branch
Clone a repository from a remote server
Create a copy of the local repository
Move the repository to a new location
What is the purpose of the 'git pull' command?
Push changes to a remote repository
Fetch changes from a remote repository and merge them
Create a new branch
Revert to a previous commit
Which command is used to create a new branch in Git?
git branch
git new
git create-branch
git make-branch
What does the 'git add' command do?
Commit changes to the repository
Add files to the staging area
Create a new branch
Delete files from the repository
How do you discard changes in your working directory and revert to the last committed version of a file?
git restore
git discard
git reset
git revert
What is a 'merge conflict' in Git?
A conflict between team members
A conflict between different branches trying to merge
A conflict in the staging area
A conflict in the commit history
What is the purpose of the '.gitignore' file?
It contains the Git repository's password
It specifies files and directories that should be ignored by Git
It defines the repository's structure
It is used for storing commit messages
Which Git command is used to view the commit history?
git status
git log
git history
git show
What does the 'git push' command do?
Pull changes from a remote repository
Push changes to a remote repository
Merge branches
Undo the last commit
What does the term 'fork' mean in the context of GitHub?
Create a copy of a repository under your GitHub account
Merge two branches
Rollback to a previous commit
Collaborate with others on a single branch
What is a 'pull request' in GitHub?
A request to merge changes from one branch to another
A request to delete a repository
A request for code review
A request for a repository backup
Which command is used to create a new repository on GitHub from the command line?
git init
git create
git new
git remote
How do you create a README file for a GitHub repository?
Using the 'git readme' command
Manually create a file named README
Automatically created by GitHub
Using the 'git create-readme' command
