Unit 3: Basic Git - 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 global user "Name"
git init user.name "Name"
git set user.name "Name"
git config --global 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 push
git move
git add
git commit
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 snap
git record
git save
git commit
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 review
git log
git history
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?
config.ignore
.gitignore
.gitremove
ignore.git
14 What command creates a new branch named 'feature-x'?
git branch feature-x
git new feature-x
git checkout feature-x
git create feature-x
15 Which command is used to switch to an existing branch?
git branch
git move
git switch-to
git checkout
16 How do you create a new branch and switch to it in a single command?
git checkout --new <branch_name>
git checkout -b <branch_name>
git branch -c <branch_name>
git switch -n <branch_name>
17 Which command merges the specified branch's history into the current branch?
git merge
git fuse
git join
git combine
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 remove
git delete
git rm
21 If you want to view the changes between the working directory and the staging area, which command should you use?
git diff
git status
git log
git diff --staged
22 Which command lists all configured remote repositories?
git remote show
git config --list-remotes
git remote -v
git remote list
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 clone
git update
git fetch
git pull
25
The command git pull is effectively a combination of which two commands?
git clone and git merge
git add and git commit
git fetch and git rebase
git fetch and git merge
26 Which command is used to upload local branch commits to the remote repository?
git send
git fetch
git upload
git push
27 How do you add a new remote repository named 'upstream'?
git remote add upstream <url>
git config remote upstream <url>
git remote new 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 show
git stash view
git stash log
git stash list
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 revert
git delete
git reset
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 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 authors
git inspect
git who
git blame
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 cherry-pick
git select
git grab
git pick
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 diff <filename>
git log <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 mv
git rename
mv then git add
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 create tag v1.0
git tag v1.0
git label v1.0
git tag -a v1.0 -m "Version 1.0"
50
What is the purpose of the git show command?
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →