1. Home
  2. Explore
  3. Computer Science
  4. Git Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Git Fundamentals

  • 118Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Git Fundamentals
A version control system records code changes over time in a database called a
.

118 questions

  1. 1
    A version control system records code changes over time in a database called a
    _____
    .
    Hint

    It stores the project's history.

    Answer

    repository

    Explanation

    A repository is the database where a version control system records changes to a project over time.

  2. 2
    A version control system lets a team inspect who changed a project, when the change occurred, and
    _____
    .
    Hint

    Think of the reason behind a change.

    Answer

    why

    Explanation

    Project history can show who made changes, when they were made, and why.

  3. 3
    If a change causes a problem, version control can return a project to an earlier
    _____
    .
    Hint

    This is a saved condition of the project.

    Answer

    state

    Explanation

    Version control makes it possible to revert a project to an earlier state.

  4. 4
    Without version control, collaborators may have to exchange code manually and then
    _____
    their changes.
    Hint

    They must combine their separate edits.

    Answer

    merge

    Explanation

    Version control helps avoid manually combining copies exchanged by email or other mechanisms.

  5. 5
    Version control systems are divided into centralized and
    _____
    systems.
    Hint

    In this kind, each team member has a project copy with history.

    Answer

    distributed

    Explanation

    The two categories described are centralized and distributed version control systems.

  6. 6
    In a centralized version control system, team members connect to a central
    _____
    to get code and share changes.
    Hint

    It is the shared network machine.

    Answer

    server

    Explanation

    A centralized system relies on a central server for obtaining code and sharing changes.

  7. 7
    Subversion and Microsoft Team Foundation Server are examples of
    _____
    version control systems.
    Hint

    They use a shared central server architecture.

    Answer

    centralized

    Explanation

    The content identifies Subversion and Microsoft Team Foundation Server as centralized systems.

  8. 8
    A central server creates a single point of
    _____
    in a centralized version control system.
    Hint

    If this occurs, the team may be unable to collaborate.

    Answer

    failure

    Explanation

    If the server goes offline, a centralized system may prevent collaboration and saving project snapshots.

  9. 9
    In a distributed system, every team member has a project copy along with its
    _____
    .
    Hint

    It records the project's previous states and changes.

    Answer

    history

    Explanation

    Distributed systems give each team member a copy of the project and its history.

  10. 10
    When a central server is offline, users of a distributed system can synchronize their work
    _____
    with one another.
    Hint

    They do not have to wait for the central server.

    Answer

    directly

    Explanation

    Distributed systems allow team members to synchronize work directly if the central server is offline.

  11. 11
    Git and Mercurial are examples of
    _____
    version control systems.
    Hint

    Each user can keep a local copy of the project history.

    Answer

    distributed

    Explanation

    The content identifies Git and Mercurial as distributed version control systems.

  12. 12
    Git is popular in part because it is free, open source, fast, and
    _____
    .
    Hint

    It can continue to work effectively as a project grows.

    Answer

    scalable

    Explanation

    The content gives Git's being free, open source, fast, and scalable as reasons for its popularity.

  13. 13
    Git operations such as branching and merging are described as especially
    _____
    compared with those in systems such as Subversion or TFS.
    Hint

    The contrast is with operations that are slow and painful.

    Answer

    fast

    Explanation

    The content contrasts Git's fast branching and merging with slower operations in some other systems.

  14. 14
    A software developer benefits from knowing Git because it supports tracking project history and
    _____
    effectively with others.
    Hint

    This is the teamwork activity enabled by sharing changes.

    Answer

    collaborating

    Explanation

    Git is used to track project history and collaborate effectively with other people.

  15. 15
    Git commands can be run in a terminal or command prompt using the
    _____
    .
    Hint

    It is a text-based interface for entering commands.

    Answer

    command line

    Explanation

    The command line is an interface for executing Git commands in a terminal or command prompt.

  16. 16
    Many code editors and IDEs provide built-in support for
    _____
    Git features.
    Hint

    These are the essential features rather than every possible capability.

    Answer

    basic

    Explanation

    Editors and IDEs often provide built-in support for basic Git functionality.

  17. 17
    In VS Code, the panel that exposes essential Git features is called Source
    _____
    .
    Hint

    It is the second word in the panel's name.

    Answer

    Control

    Explanation

    The VS Code Source Control panel offers essential Git features.

  18. 18
    GitKraken and SourceTree are examples of graphical user
    _____
    for Git.
    Hint

    These applications let people work with Git visually.

    Answer

    interfaces

    Explanation

    The content identifies GitKraken and SourceTree as popular Git graphical user interfaces.

  19. 19
    The course uses the command line extensively because GUI tools may support only commonly used Git
    _____
    .
    Hint

    These are the actions users request from Git.

    Answer

    commands

    Explanation

    GUI tools can have limitations and may not support every Git command needed for a task.

  20. 20
    A GUI tool may be unavailable when connecting remotely to a server without permission to
    _____
    software.
    Hint

    This is what a user may not be allowed to do on the server.

    Answer

    install

    Explanation

    Remote access and installation restrictions can make a GUI tool unavailable, while the command line remains accessible.

  21. 21
    The recommended approach is to use the right
    _____
    for the job, combining command-line and GUI options when useful.
    Hint

    Choose the method that best fits the task.

    Answer

    tool

    Explanation

    The content recommends choosing between command-line and GUI tools according to which is more suitable for the task.

  22. 22
    On Windows, Git Bash is short for Born Again
    _____
    .
    Hint

    It is a command-line environment that emulates Unix or Linux.

    Answer

    Shell

    Explanation

    Git Bash is named for the Born Again Shell and provides a Unix-like command environment on Windows.

  23. 23
    The command git --version displays the installed Git
    _____
    .
    Hint

    It identifies the release running on the machine.

    Answer

    version

    Explanation

    Running git --version checks whether Git is installed and reports its version.

  24. 24
    Git configuration can be set at the system, global, and
    _____
    levels.
    Hint

    This level applies to the current repository.

    Answer

    local

    Explanation

    The three configuration levels are system, global, and local.

  25. 25
    System-level Git settings apply to all users of the current
    _____
    .
    Hint

    This is the machine on which Git is configured.

    Answer

    computer

    Explanation

    System configuration applies to all users of the current computer.

  26. 26
    Global Git settings apply to all repositories belonging to the current
    _____
    .
    Hint

    This is the person whose account has the settings.

    Answer

    user

    Explanation

    Global configuration applies across repositories for the current user.

  27. 27
    Local Git settings apply to the repository in the current
    _____
    .
    Hint

    The repository's settings are scoped to this location.

    Answer

    folder

    Explanation

    Local configuration applies to the current repository or the repository in the current folder.

  28. 28
    The configuration setting user.name stores the Git user's
    _____
    .
    Hint

    It identifies the author in commit metadata.

    Answer

    name

    Explanation

    The user.name setting configures the user's name for Git.

  29. 29
    The configuration setting user.email stores the Git user's
    _____
    .
    Hint

    It identifies the author's email in commit metadata.

    Answer

    email

    Explanation

    The user.email setting configures the user's email address for Git.

  30. 30
    On a Mac, Git may use Vim by default if a different default
    _____
    is not configured.
    Hint

    It is the program used to write longer commit messages.

    Answer

    editor

    Explanation

    The content notes that Git may use Vim as its default editor on a Mac unless another editor is configured.

  31. 31
    The code --wait option makes the terminal wait until the VS Code instance is
    _____
    .
    Hint

    Git can continue after the editor window is no longer open.

    Answer

    closed

    Explanation

    The wait flag prevents the terminal from continuing until the VS Code instance has been closed.

  32. 32
    The command git config --global -e opens the global configuration file in the default
    _____
    .
    Hint

    This is the configured application for editing text.

    Answer

    editor

    Explanation

    The command opens the user's global Git configuration in the default editor.

  33. 33
    On Windows, line endings are conventionally marked with carriage return and line feed, while Mac and Linux use line
    _____
    .
    Hint

    It is the second part of the Unix-style line-ending name.

    Answer

    feed

    Explanation

    Windows uses carriage return plus line feed, while Mac and Linux use line feed.

  34. 34
    The setting core.autocrlf controls how Git handles line
    _____
    .
    Hint

    These mark where one line of a text file stops.

    Answer

    endings

    Explanation

    The core.autocrlf setting helps Git handle differences in line-ending conventions across operating systems.

  35. 35
    On Windows, core.autocrlf should be set to
    _____
    so Git can adjust line endings when checking code in and out.
    Hint

    This value enables Git's Windows line-ending conversion behavior.

    Answer

    true

    Explanation

    The content recommends setting core.autocrlf to true on Windows.

  36. 36
    On Mac or Linux, core.autocrlf should be set to
    _____
    so Git modifies line endings when storing code in the repository.
    Hint

    This value limits the conversion to input into the repository.

    Answer

    input

    Explanation

    The content recommends input on Mac or Linux; Git removes carriage returns when storing code but does not add them on checkout.

  37. 37
    The git config --help command opens the full command
    _____
    for Git configuration.
    Hint

    It includes detailed options and explanations.

    Answer

    documentation

    Explanation

    The help option displays the full documentation for the command.

  38. 38
    The command git config -h provides a short
    _____
    of the command and its options.
    Hint

    It is a quick refresher rather than full documentation.

    Answer

    summary

    Explanation

    The short help option gives a concise summary of the command and its options.

  39. 39
    The command git init creates a new empty Git
    _____
    in the current project directory.
    Hint

    It establishes the project's Git history area.

    Answer

    repository

    Explanation

    Initializing a project with git init creates a new empty repository.

  40. 40
    A newly initialized repository stores its internal data in a hidden subdirectory named
    _____
    .
    Hint

    The directory's name begins with a dot.

    Answer

    .git

    Explanation

    Git keeps repository information and project history in the hidden .git subdirectory.

  41. 41
    The command ls -a displays hidden files as well as ordinary files; the -a means
    _____
    .
    Hint

    It includes entries normally hidden from a basic listing.

    Answer

    all

    Explanation

    The -a option is short for all and reveals hidden entries such as .git.

  42. 42
    Deleting the .git directory removes the repository's project
    _____
    .
    Hint

    This is the information Git has recorded over time.

    Answer

    history

    Explanation

    Removing .git destroys the repository data, including its project history.

  43. 43
    The area where proposed changes are gathered before a commit is called the staging area or the
    _____
    .
    Hint

    This is another Git term for the intermediate area.

    Answer

    index

    Explanation

    The staging area, also called the index, holds the proposed content for the next commit.

  44. 44
    A Git commit is like taking a
    _____
    of the project at a particular point in time.
    Hint

    It records the project's state rather than just a to-do list.

    Answer

    snapshot

    Explanation

    A commit records a snapshot of the project at a particular point in time.

  45. 45
    In the basic Git workflow, changes are added to the staging area, reviewed, and then
    _____
    .
    Hint

    This permanently records the proposed snapshot in the repository.

    Answer

    committed

    Explanation

    After staging and reviewing changes, the user commits them to the repository.

  46. 46
    The staging area allows a developer to review proposed changes before recording a project
    _____
    .
    Hint

    The review occurs before the next recorded state is saved.

    Answer

    snapshot

    Explanation

    The staging area provides an opportunity to inspect proposed content before committing a snapshot.

  47. 47
    If only some changes should be included in the next snapshot, the remaining changes can be
    _____
    and committed later.
    Hint

    They are removed from the proposed commit without necessarily discarding them.

    Answer

    unstaged

    Explanation

    Unstaging lets a developer keep changes out of the next commit and include them in a later one.

  48. 48
    After a commit, the staging area contains the same snapshot that was stored in the
    _____
    .
    Hint

    This is where the committed snapshot is permanently recorded.

    Answer

    repository

    Explanation

    A commit does not automatically empty the staging area; it retains the snapshot that matches the repository's latest commit.

  49. 49
    If a file is changed after it has been staged, the staging area still contains the earlier version until the change is staged
    _____
    .
    Hint

    A new staging operation updates the proposed snapshot.

    Answer

    again

    Explanation

    Staging takes a snapshot of a file, so edits made afterward must be staged again to update the proposed commit.

  50. 50
    Staging a deletion updates the proposed snapshot so the deleted file is removed from the
    _____
    .
    Hint

    This is the intermediate area representing the next commit.

    Answer

    staging area

    Explanation

    When a deleted file is staged, Git removes it from the staging area so the deletion can be committed.

  51. 51
    Each commit contains a unique identifier automatically generated by
    _____
    .
    Hint

    It is the version control system creating the commit.

    Answer

    Git

    Explanation

    Git generates a unique identifier for each commit.

  52. 52
    Git commits contain full project snapshots rather than storing only the
    _____
    of what changed.
    Hint

    This term refers to differences between versions.

    Answer

    deltas

    Explanation

    The content contrasts Git's full snapshots with systems that store only deltas or changes.

  53. 53
    Git can store full snapshots efficiently because it compresses file contents and avoids storing
    _____
    content.
    Hint

    A repeated copy of the same data is unnecessary.

    Answer

    duplicate

    Explanation

    Git uses compression and does not store duplicate content, helping make full snapshots space-efficient.

  54. 54
    The command echo in the demonstrations is a standard Unix or Linux command for writing content to a
    _____
    .
    Hint

    It can send text such as โ€œhelloโ€ into one of these.

    Answer

    file

    Explanation

    The examples use echo to write text into files; it is not a Git command.

  55. 55
    Files present when a repository is first initialized are not automatically tracked; they are initially
    _____
    .
    Hint

    Git has not yet been instructed to include them.

    Answer

    untracked

    Explanation

    Git does not automatically track files when a repository is initialized; users must add them.

  56. 56
    The command git status reports the state of the working directory and the
    _____
    .
    Hint

    It also shows which changes are prepared for the next commit.

    Answer

    staging area

    Explanation

    git status reports files and changes in both the working directory and staging area.

  57. 57
    The command git add file1.txt places that file's current contents in the
    _____
    .
    Hint

    It prepares the file for a future commit.

    Answer

    staging area

    Explanation

    git add stages the selected file by adding its current snapshot to the staging area.

  58. 58
    The pattern *.txt with git add selects files that have the
    _____
    .
    Hint

    It matches text files with this suffix.

    Answer

    .txt extension

    Explanation

    The *.txt pattern can be used to stage all files with the .txt extension.

  59. 59
    The command git add . adds the current directory and its contents
    _____
    to the staging area.
    Hint

    This includes files in subdirectories as well.

    Answer

    recursively

    Explanation

    The dot pattern stages the entire directory recursively, so users should check for files they do not want to include.

  60. 60
    The -m option in git commit -m supplies a short commit
    _____
    .
    Hint

    It describes what the snapshot represents.

    Answer

    message

    Explanation

    The -m option lets a user provide a commit message directly on the command line.

  61. 61
    When a short commit message is insufficient, running git commit without a message option opens the default
    _____
    .
    Hint

    The user can write a longer description there.

    Answer

    editor

    Explanation

    Running git commit without -m opens the configured editor for the commit message.

  62. 62
    A longer commit message can place a concise description on the first line and additional context after a line
    _____
    .
    Hint

    It separates the summary from the detailed description.

    Answer

    break

    Explanation

    The demonstrated format uses a short description, a blank line, and then a longer explanation.

  63. 63
    Commit-message lines beginning with a hash sign in the editor are treated as
    _____
    .
    Hint

    Git does not include these lines as the commit message.

    Answer

    comments

    Explanation

    Lines beginning with the hash sign are comments and are ignored by Git.

  64. 64
    A commit should be large enough to represent useful work but not so large that it combines unrelated changes; it should represent a logically separate change
    _____
    .
    Hint

    This phrase describes a coherent group of related edits.

    Answer

    set

    Explanation

    Each commit should represent a logically separate change set rather than unrelated tasks or an excessive amount of work.

  65. 65
    A useful commit message explains the change, making the project's
    _____
    more helpful to teammates.
    Hint

    These messages appear alongside recorded project changes.

    Answer

    history

    Explanation

    Meaningful messages help the author and teammates understand the project history.

  66. 66
    A common commit-message convention is to use the
    _____
    tense, such as โ€œfix the bug.โ€
    Hint

    It describes the change as an action happening now.

    Answer

    present

    Explanation

    The content notes that many people prefer present-tense commit messages, while emphasizing consistency within a team.

  67. 67
    The -a option for git commit includes all
    _____
    files in the commit, allowing the staging step to be skipped.
    Hint

    It does not refer to newly untracked files in the demonstrated usage.

    Answer

    modified

    Explanation

    The -a option commits modified tracked files without requiring a separate git add step; the content recommends staging in most cases.

  68. 68
    The staging area should generally be used before committing because it lets developers
    _____
    their changes first.
    Hint

    This is the main purpose of the intermediate step.

    Answer

    review

    Explanation

    Staging provides a chance to review the proposed changes before they are committed.

  69. 69
    Removing a file with the Unix rm command affects the working directory, while the staged copy remains until the deletion is
    _____
    .
    Hint

    Git must be told to include the removal in the next commit.

    Answer

    staged

    Explanation

    The deletion must be staged before the repository's next snapshot reflects it.

  70. 70
    The command git ls-files lists files currently in the
    _____
    .
    Hint

    This is also known as the index.

    Answer

    staging area

    Explanation

    git ls-files can be used to inspect the files in the staging area.

  71. 71
    The command git rm file2.txt removes a file from both the working directory and the
    _____
    .
    Hint

    It updates the proposed commit as well as the local files.

    Answer

    staging area

    Explanation

    Unlike the ordinary rm command, git rm removes the file from both the working directory and staging area.

  72. 72
    Renaming a file with the Unix mv command first creates a working-directory deletion and a new
    _____
    .
    Hint

    The new path appears as an untracked item until staged.

    Answer

    file

    Explanation

    A rename made outside Git appears as a deletion plus a new untracked file, which must then be staged.

  73. 73
    The Git command for renaming or moving a tracked file while updating both the working directory and staging area is git
    _____
    .
    Hint

    It uses the same short name as the Unix move command.

    Answer

    mv

    Explanation

    git mv updates the file's location in both the working directory and staging area.

  74. 74
    The file used to tell Git which paths to ignore is named
    _____
    .
    Hint

    It is a hidden-style filename in the project root.

    Answer

    .gitignore

    Explanation

    A .gitignore file lists files, patterns, and directories that Git should ignore.

  75. 75
    A .gitignore file should be placed in the
    _____
    of the project for the examples shown.
    Hint

    It is the top-level project directory.

    Answer

    root

    Explanation

    The content places the .gitignore file in the root of the project.

  76. 76
    An entry ending in a slash, such as logs/, tells Git to ignore a
    _____
    .
    Hint

    It contains files and possibly other folders.

    Answer

    directory

    Explanation

    A directory pattern ending in a slash can be used to ignore that directory and its contents.

  77. 77
    Generated binary files and logs are often ignored because they can increase repository size without providing value or needing to be
    _____
    .
    Hint

    These files are often specific to each developer or generated locally.

    Answer

    shared

    Explanation

    The content recommends ignoring generated or personal files such as logs and binary outputs rather than synchronizing them with teammates.

  78. 78
    Adding a path to .gitignore does not stop Git tracking it if it has already been
    _____
    into the repository.
    Hint

    Ignore rules do not automatically untrack existing files.

    Answer

    included

    Explanation

    A .gitignore rule does not affect a file that Git already tracks; it must first be removed from the index.

  79. 79
    The --cached option of git rm removes a path from the index while leaving it in the working
    _____
    .
    Hint

    The local file remains available on disk.

    Answer

    directory

    Explanation

    git rm --cached removes a tracked path from the index without deleting the working copy.

  80. 80
    The -r option is needed when removing an entire directory because the removal must be
    _____
    .
    Hint

    The operation must include the directory's contents.

    Answer

    recursive

    Explanation

    Git requires the recursive option to remove a directory and its contents from the index.

  81. 81
    Git ignore templates often exclude Java .class files because they are generated when code is
    _____
    .
    Hint

    This is the process that produces the class files.

    Answer

    compiled

    Explanation

    The content explains that Java class files are automatically generated during compilation and usually need not be stored in the repository.

  82. 82
    In short git status -s output, the left column represents the staging area and the right column represents the working
    _____
    .
    Hint

    This is where local file edits happen.

    Answer

    directory

    Explanation

    Short status uses two columns: the left for staged state and the right for working-directory state.

  83. 83
    In short status output, a red M in the right column indicates a modified file with changes in the working directory that are not yet
    _____
    .
    Hint

    The changes have not been added to the index.

    Answer

    staged

    Explanation

    An M in the right column indicates unstaged modifications in the working directory.

  84. 84
    In short status output, two question marks indicate a file that is
    _____
    .
    Hint

    Git has not yet been told to include it.

    Answer

    untracked

    Explanation

    A pair of question marks marks an untracked file in the short status format.

  85. 85
    In short status output, a green A in the left column means a file has been
    _____
    .
    Hint

    It is a new file prepared for the next commit.

    Answer

    added

    Explanation

    An A in the staging-area column indicates an added file.

  86. 86
    The command git diff --staged shows changes in the staging area that are proposed for the next
    _____
    .
    Hint

    This is the snapshot the staged content will enter.

    Answer

    commit

    Explanation

    The staged diff compares the staged content with the last committed snapshot.

  87. 87
    The command git diff with no arguments compares the working directory with the
    _____
    .
    Hint

    It reveals changes that have not yet been staged.

    Answer

    staging area

    Explanation

    An unstaged diff shows differences between the working directory and the staging area.

  88. 88
    In a diff, lines removed from the old copy are marked with a minus sign, while lines added to the new copy are marked with a
    _____
    sign.
    Hint

    It is the symbol used for newly added lines.

    Answer

    plus

    Explanation

    Diff output uses minus signs for removed lines and plus signs for added lines.

  89. 89
    A diff header divides changes into chunks and provides context about which parts of a file have
    _____
    .
    Hint

    It describes the areas affected by edits.

    Answer

    changed

    Explanation

    Diff headers identify the sections of a file represented in each chunk.

  90. 90
    When a file is entirely new, the old-file side of its diff has no content and can show a range of
    _____
    lines.
    Hint

    There are no old lines for a file absent from the previous commit.

    Answer

    zero

    Explanation

    A newly added file has no old copy, so the old side of the diff has zero lines.

  91. 91
    The configuration value diff.tool names the default visual diff
    _____
    .
    Hint

    It tells Git which comparison application to launch.

    Answer

    tool

    Explanation

    Setting diff.tool assigns a name to the default program for visually comparing changes.

  92. 92
    The --diff argument tells VS Code to open in file-comparison
    _____
    .
    Hint

    It signals how the editor should be used.

    Answer

    mode

    Explanation

    The configured command launches VS Code with the diff option to compare files.

  93. 93
    In the visual diff configuration, $LOCAL and $REMOTE act as placeholders for the old and new file
    _____
    .
    Hint

    They represent the two versions being compared.

    Answer

    copies

    Explanation

    The configured visual tool receives the local and remote versions as the two copies to compare.

  94. 94
    Visual diff tools can compare staged changes with git difftool --staged, while omitting that option compares
    _____
    .
    Hint

    These are edits not yet present in the index.

    Answer

    unstaged changes

    Explanation

    Without the staged option, the visual diff tool shows working-directory changes relative to the staging area.

  95. 95
    A commit message and a concise identifier are not enough to see exact edited lines; the command used to inspect a commit's changes is git
    _____
    .
    Hint

    It displays commit information and a diff.

    Answer

    show

    Explanation

    git show displays information about a specified commit, including its changes.

  96. 96
    The git log command lists commits from the
    _____
    commit toward earlier commits by default.
    Hint

    It places the most recent entry first.

    Answer

    latest

    Explanation

    The default log ordering shows the latest commit first and earlier commits afterward.

  97. 97
    A full Git commit identifier is a 40-character
    _____
    string.
    Hint

    It uses digits and letters from a base-16 character set.

    Answer

    hexadecimal

    Explanation

    Git generates commit identifiers as 40-character hexadecimal strings.

  98. 98
    The --oneline option shortens commit identifiers to seven characters and displays a one-line
    _____
    .
    Hint

    This is the brief commit message summary.

    Answer

    description

    Explanation

    The short log format displays abbreviated identifiers and one-line commit descriptions.

  99. 99
    The --reverse option changes the log order so the
    _____
    commit appears first.
    Hint

    It reverses the default newest-first ordering.

    Answer

    earliest

    Explanation

    Using reverse order lists commits from earliest to latest.

  100. 100
    In the log output described, HEAD is a reference to the current
    _____
    .
    Hint

    It identifies the line of work currently checked out.

    Answer

    branch

    Explanation

    HEAD tells Git which branch is currently active.

  101. 101
    The main line of work is traditionally called master, while some other version control systems call it the
    _____
    .
    Hint

    It is another name for the primary line of development.

    Answer

    trunk

    Explanation

    The content compares Git's traditional main branch name with the term trunk used in other systems.

  102. 102
    The notation HEAD~1 refers to the commit one step
    _____
    from the current commit.
    Hint

    It selects the previous commit in the history.

    Answer

    back

    Explanation

    A tilde followed by a number moves backward that many commits from HEAD.

  103. 103
    A commit can be referenced by its identifier using only enough starting characters to make the identifier
    _____
    .
    Hint

    No other commit may begin with the same selected characters.

    Answer

    unambiguous

    Explanation

    A shortened commit ID works as long as it uniquely identifies the commit.

  104. 104
    The git show commit:path form displays the exact version of a file stored in that
    _____
    .
    Hint

    It retrieves the file from a particular recorded snapshot.

    Answer

    commit

    Explanation

    Adding a path to git show displays the file contents as stored in the specified commit.

  105. 105
    The command git ls-tree lists files and directories stored in a commit, representing the hierarchy as a
    _____
    .
    Hint

    This data structure consists of nodes and children.

    Answer

    tree

    Explanation

    A tree is a hierarchical data structure suitable for representing directories and their contents.

  106. 106
    In Git's object database, file contents are represented by
    _____
    , while directories are represented by trees.
    Hint

    This is the object type used for files.

    Answer

    blobs

    Explanation

    Git represents files as blob objects and directories as tree objects.

  107. 107
    Git's object database can contain commits, blobs, trees, and
    _____
    .
    Hint

    These can be used to label particular points or objects.

    Answer

    tags

    Explanation

    The content names commits, blobs, trees, and tags as Git object types.

  108. 108
    The command git restore --staged file1.js removes the file's staged changes while leaving the changes in the working
    _____
    .
    Hint

    The local edits remain in the file on disk.

    Answer

    directory

    Explanation

    Restoring a file with the staged option resets its index version to the last commit without discarding its working-directory edits.

  109. 109
    When restoring from the staging area, Git takes the version from the next environment, which is the last
    _____
    .
    Hint

    It is the recorded snapshot immediately before the staged state.

    Answer

    commit

    Explanation

    The staging area is restored from the repository's latest committed version by default.

  110. 110
    If a newly added file has no copy in the last commit, restoring it with the staged option removes it from the index and returns it to an
    _____
    state.
    Hint

    Git has no previously committed version to restore.

    Answer

    untracked

    Explanation

    A new file absent from the last commit is removed from the staging area and becomes untracked when restored there.

  111. 111
    Running git restore file1.js without the staged option discards working-directory edits by restoring the version from the
    _____
    .
    Hint

    This is the next environment after the working directory.

    Answer

    staging area

    Explanation

    By default, restore copies a file from the next environment; for working-directory changes, that is the staging area.

  112. 112
    The command git clean removes untracked files, and its -f option means
    _____
    .
    Hint

    Git requires this option because removing untracked files can be dangerous.

    Answer

    force

    Explanation

    The force option confirms that Git should remove untracked files that may otherwise be unrecoverable.

  113. 113
    The -d option with git clean allows removal of untracked
    _____
    .
    Hint

    These are folders rather than individual files.

    Answer

    directories

    Explanation

    The directory option extends cleaning to whole untracked directories.

  114. 114
    The combined command git clean -fd forcefully removes untracked files and
    _____
    .
    Hint

    The -d option adds these to the removal operation.

    Answer

    directories

    Explanation

    The -f and -d options are commonly combined to remove untracked files and directories.

  115. 115
    Once Git tracks a file, its versions are stored in Git's database, which makes it possible to restore earlier
    _____
    .
    Hint

    These are previous states of the same file.

    Answer

    versions

    Explanation

    Git records tracked file content in its database, enabling restoration of previous versions.

  116. 116
    The git rm command removes a file from both the working directory and staging area, so the deletion can be recorded in a
    _____
    .
    Hint

    This saves the removal in project history.

    Answer

    commit

    Explanation

    After git rm, committing records the file's deletion in the repository history.

  117. 117
    To restore a file from the commit before the latest one, git restore --source can use the reference
    _____
    .
    Hint

    It points one commit behind the current one.

    Answer

    HEAD~1

    Explanation

    The source option lets restore take a file from a specified commit, such as HEAD~1.

  118. 118
    The --source option changes the default restore behavior by specifying which
    _____
    supplies the file version.
    Hint

    It identifies the historical snapshot to use.

    Answer

    commit

    Explanation

    By default, restore copies from the next environment; --source selects a particular commit instead.

1 of 118
Question 1 of 118

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent