What is Git primarily used for?
Answer: c) Version control
Which command is used to initialize a new Git repository?
git init
git start
git create
git new
git init
Which command is used to check the status of your files in the working directory and staging area?
git check
git status
git diff
git log
git status
How do you stage changes for the next commit?
git add .
git commit -m "message"
git push
git stage
git add .
Which command is used to commit changes to the local repository?
git commit -m "message"
git push
git add
git status
git commit -m "message"
How do you clone a repository from GitHub?
git clone [repository_url]
git fork [repository_url]
git copy [repository_url]
git download [repository_url]
git clone [repository_url]
Which command is used to create a new branch in Git?
git new branch [branch_name]
git create branch [branch_name]
git branch [branch_name]
git checkout -b [branch_name]
git branch [branch_name]
How do you switch to another branch in Git?
git switch [branch_name]
git branch [branch_name]
git checkout [branch_name]
git change [branch_name]
git checkout [branch_name]
How do you view the commit history in Git?
git history
git log
git commits
git show
git log
What is GitHub Desktop used for?
Answer: a) Version control using a graphical interface
How do you discard changes in your working directory?
git discard
git remove
git reset --hard
git clean
git reset --hard
Which command is used to delete a branch in Git?
git remove branch [branch_name]
git delete branch [branch_name]
git branch -d [branch_name]
git branch --delete [branch_name]
git branch -d [branch_name]
What is a 'commit' in Git?
Answer: b) A snapshot of the repository at a specific point in time
What is the purpose of the .gitignore
file?
Answer: b) To ignore specified files and directories from being tracked by Git
What is a 'remote' in Git?
Answer: b) A repository stored on another machine
Which command is used to display differences between commits, commit and working tree, etc.?
What is the purpose of the git config
command?
Which command is used to undo the last commit while keeping the changes in the working directory?
Which command is used to list all branches in the repository?
Which command is used to view a specific commit in Git?