Unit 3 - Practice Quiz
INT331
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 save
git commit
git snap
git record
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 history
git log
git review
git past
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?
.gitignore
ignore.git
.gitremove
config.ignore
14 What command creates a new branch named 'feature-x'?
git checkout feature-x
git branch feature-x
git create feature-x
git new feature-x
15 Which command is used to switch to an existing branch?
git branch
git checkout
git switch-to
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 join
git fuse
git combine
git merge
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?
rm
git rm
git delete
git remove
21 If you want to view the changes between the working directory and the staging area, which command should you use?
git diff
git diff --staged
git status
git log
22 Which command lists all configured remote repositories?
git remote list
git remote -v
git remote show
git config --list-remotes
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 pull
git fetch
git clone
git update
25
The command git pull is effectively a combination of which two commands?
git fetch and git merge
git clone and git merge
git fetch and git rebase
git add and git commit
26 Which command is used to upload local branch commits to the remote repository?
git upload
git fetch
git push
git send
27 How do you add a new remote repository named 'upstream'?
git remote add upstream <url>
git remote new upstream <url>
git config remote upstream <url>
git add 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 log
git stash view
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 undo
git reset
git revert
git delete
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 branch -D <branch_name>
git remove <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 who
git blame
git inspect
git authors
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 pick
git cherry-pick
git grab
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 history <filename>
git status <filename>
git diff <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 modifies the working directory, while --mixed keeps working directory changes.
--hard creates a backup, --mixed deletes files.
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?
mv then git add
git rename
git mv
git change
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 tag v1.0
git tag -a v1.0 -m "Version 1.0"
git create tag v1.0
git label v1.0
50
What is the purpose of the git show command?