Unit 3 - Practice Quiz

INT331 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is Git primarily classified as?

A. Local Version Control System
B. Centralized Version Control System
C. Distributed Version Control System
D. Relational Database Management System

2 Who originally created Git?

A. James Gosling
B. Guido van Rossum
C. Linus Torvalds
D. Dennis Ritchie

3 In Git, what is the purpose of the .git directory?

A. It stores the production build artifacts.
B. It contains the user's manual for Git.
C. It is a temporary folder for deleted files.
D. It stores all the version control metadata and the object database.

4 Which command allows you to configure your username globally in Git?

A. git config --global user.name "Name"
B. git set user.name "Name"
C. git global user "Name"
D. git init user.name "Name"

5 What are the three main states that files can reside in within Git?

A. Modified, Staged, Committed
B. Active, Passive, Archived
C. Created, Updated, Deleted
D. Local, Remote, Upstream

6 Which command moves a file from the 'Modified' state to the 'Staged' state?

A. git commit
B. git push
C. git add
D. git move

7 What functionality does git clone provide?

A. It duplicates a branch within the same repository.
B. It copies the latest commit only.
C. It creates a new empty repository locally.
D. It creates a copy of an existing remote repository into a new directory.

8 What is the function of git status?

A. It shows the difference between file versions.
B. It displays the state of the working directory and the staging area.
C. It shows the status of the remote server connectivity.
D. It lists the commit history.

9 Which command captures a snapshot of the project's currently staged changes?

A. git commit
B. git save
C. git record
D. git snap

10 How does Git identify the integrity of the objects (commits, files, etc.) stored in its database?

A. Using sequential integers (1, 2, 3...)
B. Using timestamps
C. Using file names
D. Using a SHA-1 hash

11 Which command is used to view the commit history?

A. git past
B. git history
C. git review
D. git log

12 What is the default name of the master branch in modern Git installations (standardized to be more inclusive)?

A. root
B. main
C. trunk
D. base

13 Which file is used to specify intentionally untracked files to ignore?

A. ignore.git
B. .gitremove
C. config.ignore
D. .gitignore

14 What command creates a new branch named 'feature-x'?

A. git checkout feature-x
B. git create feature-x
C. git branch feature-x
D. git new feature-x

15 Which command is used to switch to an existing branch?

A. git checkout
B. git switch-to
C. git branch
D. git move

16 How do you create a new branch and switch to it in a single command?

A. git checkout -b <branch_name>
B. git branch -c <branch_name>
C. git switch -n <branch_name>
D. git checkout --new <branch_name>

17 Which command merges the specified branch's history into the current branch?

A. git merge
B. git fuse
C. git combine
D. git join

18 What is a 'Fast-forward' merge?

A. A merge performed on a remote server only.
B. A merge where the branch pointer simply moves forward because there is no divergent work.
C. A merge that skips conflict resolution.
D. A merge that happens automatically every hour.

19 What is 'HEAD' in Git?

A. The remote server address.
B. The administrator of the repository.
C. A pointer to the local branch/commit you are currently on.
D. The first commit of the repository.

20 Which command removes a file from the working directory and the staging area?

A. git remove
B. rm
C. git rm
D. git delete

21 If you want to view the changes between the working directory and the staging area, which command should you use?

A. git log
B. git diff --staged
C. git diff
D. git status

22 Which command lists all configured remote repositories?

A. git remote show
B. git remote list
C. git config --list-remotes
D. git remote -v

23 What is the default name Git gives to the server you cloned from?

A. master
B. origin
C. remote
D. upstream

24 Which command downloads changes from a remote repository but does NOT merge them into your current work?

A. git fetch
B. git clone
C. git update
D. git pull

25 The command git pull is effectively a combination of which two commands?

A. git clone and git merge
B. git fetch and git rebase
C. git add and git commit
D. git fetch and git merge

26 Which command is used to upload local branch commits to the remote repository?

A. git fetch
B. git send
C. git push
D. git upload

27 How do you add a new remote repository named 'upstream'?

A. git remote add upstream <url>
B. git add remote upstream <url>
C. git remote new upstream <url>
D. git config remote upstream <url>

28 What feature allows you to save unfinished work without committing it, to clean the working directory?

A. Branching
B. Tagging
C. Stashing
D. Reverting

29 Which command would you use to list the stash stack?

A. git stash list
B. git stash show
C. git stash view
D. git stash log

30 What is the purpose of git tag?

A. To categorize files by type.
B. To tag a user in a commit message.
C. To mark specific points in history as important (e.g., releases).
D. To highlight syntax in code.

31 What does git reset --soft HEAD~1 do?

A. Undoes the last commit but keeps changes in the staging area.
B. Resets the repository to the initial state.
C. Undoes the last commit and keeps changes in the working directory (unstaged).
D. Deletes the last commit and all changes in files.

32 What is a 'merge conflict'?

A. When the remote server is down.
B. When two users have the same username.
C. When a file is too large to merge.
D. When Git cannot automatically resolve differences in code between two commits.

33 Which command creates a new commit that applies the inverse of a specified commit (effectively undoing it history-safe)?

A. git reset
B. git delete
C. git revert
D. git undo

34 What is the output of git log --oneline?

A. The full commit message and date.
B. A condensed history showing abbreviated hash and subject line.
C. A detailed history including diffs.
D. A list of branches.

35 When working with a remote, what does 'tracking branch' mean?

A. A local branch that has a direct relationship with a remote branch.
B. A branch that is currently being merged.
C. A branch that records user activity logs.
D. A branch used only for bug tracking.

36 Which command is used to delete a local branch safely (only if merged)?

A. git branch -d <branch_name>
B. git remove <branch_name>
C. git branch -D <branch_name>
D. git delete <branch_name>

37 What is the area called where Git stores the changes before they are committed?

A. The Cache
B. The Staging Area (or Index)
C. The Workspace
D. The Playground

38 Which command displays who modified each line of a file and when?

A. git blame
B. git inspect
C. git authors
D. git who

39 In the Git workflow, what is the best practice before pushing your changes to a shared remote?

A. Create a new remote.
B. Pull the latest changes from the remote to ensure no conflicts.
C. Delete your local repository.
D. Force push your changes.

40 How do you apply a specific commit from one branch to another without merging the whole branch?

A. git grab
B. git pick
C. git cherry-pick
D. git select

41 What does the command git init do?

A. Initializes the user profile.
B. Installs Git software.
C. Initializes a new, empty Git repository.
D. Connects to the internet.

42 If you modify a file that is already tracked, what is its status before staging?

A. Untracked
B. Committed
C. Modified
D. Stashed

43 Which command would you use to see the commit history of a specific file?

A. git log <filename>
B. git diff <filename>
C. git status <filename>
D. git history <filename>

44 What is the primary difference between git reset --hard and git reset --mixed (default)?

A. --hard changes the commit history, --mixed does not.
B. --hard creates a backup, --mixed deletes files.
C. --hard modifies the working directory, while --mixed keeps working directory changes.
D. There is no difference.

45 In the context of Git, what is a 'fork'?

A. A standard Git command.
B. A split in the command line interface.
C. A type of merge conflict.
D. A server-side copy of a repository (common in GitHub/GitLab workflows).

46 What happens if you try to git push but your local history is behind the remote history?

A. Git will automatically merge the changes.
B. Git will create a new branch.
C. Git will overwrite the remote changes.
D. Git will reject the push.

47 Which command is used to rename a file in a way that Git records the move?

A. git change
B. git mv
C. git rename
D. mv then git add

48 What character is used to separate directories in Git internal paths, regardless of the OS?

A. Backslash \
B. Forward slash /
C. Colon :
D. Pipe |

49 Which command creates a specific tag v1.0 with a message?

A. git create tag v1.0
B. git label v1.0
C. git tag v1.0
D. git tag -a v1.0 -m "Version 1.0"

50 What is the purpose of the git show command?

A. To show details about a specific object (commit, tag, etc.).
B. To show the current branch name.
C. To show the help manual.
D. To show the remote URL.