Unit 3 - Practice Quiz
1 What is Git primarily classified as?
2 Who originally created Git?
3
In Git, what is the purpose of the .git directory?
4 Which command allows you to configure your username globally in Git?
git config --global user.name "Name"
git set user.name "Name"
git global user "Name"
git init user.name "Name"
5 What are the three main states that files can reside in within Git?
6 Which command moves a file from the 'Modified' state to the 'Staged' state?
git commit
git push
git add
git move
7
What functionality does git clone provide?
8
What is the function of git status?
9 Which command captures a snapshot of the project's currently staged changes?
git commit
git save
git record
git snap
10 How does Git identify the integrity of the objects (commits, files, etc.) stored in its database?
11 Which command is used to view the commit history?
git past
git history
git review
git log
12 What is the default name of the master branch in modern Git installations (standardized to be more inclusive)?
13 Which file is used to specify intentionally untracked files to ignore?
ignore.git
.gitremove
config.ignore
.gitignore
14 What command creates a new branch named 'feature-x'?
git checkout feature-x
git create feature-x
git branch feature-x
git new feature-x
15 Which command is used to switch to an existing branch?
git checkout
git switch-to
git branch
git move
16 How do you create a new branch and switch to it in a single command?
git checkout -b <branch_name>
git branch -c <branch_name>
git switch -n <branch_name>
git checkout --new <branch_name>
17 Which command merges the specified branch's history into the current branch?
git merge
git fuse
git combine
git join
18 What is a 'Fast-forward' merge?
19 What is 'HEAD' in Git?
20 Which command removes a file from the working directory and the staging area?
git remove
rm
git rm
git delete
21 If you want to view the changes between the working directory and the staging area, which command should you use?
git log
git diff --staged
git diff
git status
22 Which command lists all configured remote repositories?
git remote show
git remote list
git config --list-remotes
git remote -v
23 What is the default name Git gives to the server you cloned from?
24 Which command downloads changes from a remote repository but does NOT merge them into your current work?
git fetch
git clone
git update
git pull
25
The command git pull is effectively a combination of which two commands?
git clone and git merge
git fetch and git rebase
git add and git commit
git fetch and git merge
26 Which command is used to upload local branch commits to the remote repository?
git fetch
git send
git push
git upload
27 How do you add a new remote repository named 'upstream'?
git remote add upstream <url>
git add remote upstream <url>
git remote new upstream <url>
git config remote upstream <url>
28 What feature allows you to save unfinished work without committing it, to clean the working directory?
29 Which command would you use to list the stash stack?
git stash list
git stash show
git stash view
git stash log
30
What is the purpose of git tag?
31
What does git reset --soft HEAD~1 do?
32 What is a 'merge conflict'?
33 Which command creates a new commit that applies the inverse of a specified commit (effectively undoing it history-safe)?
git reset
git delete
git revert
git undo
34
What is the output of git log --oneline?
35 When working with a remote, what does 'tracking branch' mean?
36 Which command is used to delete a local branch safely (only if merged)?
git branch -d <branch_name>
git remove <branch_name>
git branch -D <branch_name>
git delete <branch_name>
37 What is the area called where Git stores the changes before they are committed?
38 Which command displays who modified each line of a file and when?
git blame
git inspect
git authors
git who
39 In the Git workflow, what is the best practice before pushing your changes to a shared remote?
40 How do you apply a specific commit from one branch to another without merging the whole branch?
git grab
git pick
git cherry-pick
git select
41
What does the command git init do?
42 If you modify a file that is already tracked, what is its status before staging?
43 Which command would you use to see the commit history of a specific file?
git log <filename>
git diff <filename>
git status <filename>
git history <filename>
44
What is the primary difference between git reset --hard and git reset --mixed (default)?
--hard changes the commit history, --mixed does not.
--hard creates a backup, --mixed deletes files.
--hard modifies the working directory, while --mixed keeps working directory changes.
45 In the context of Git, what is a 'fork'?
46
What happens if you try to git push but your local history is behind the remote history?
47 Which command is used to rename a file in a way that Git records the move?
git change
git mv
git rename
mv then git add
48 What character is used to separate directories in Git internal paths, regardless of the OS?
\
/
:
|
49
Which command creates a specific tag v1.0 with a message?
git create tag v1.0
git label v1.0
git tag v1.0
git tag -a v1.0 -m "Version 1.0"
50
What is the purpose of the git show command?