Skip to content

  • Home
  • Courses
    • Git
  • Tutorial
  • Practise
    • Git
  • Contact
Follow
Follow

  • Home
  • Courses
    • Git
  • Tutorial
  • Practise
    • Git
  • Contact

Basic Git Questions

Level : Beginner

Which files should we usually ignore in a version control system?

  • A. Files that contain secret tokens, personal preferences, or editor settings
  • B. Files that are binary, such as executables, images, and videos
  • C. Files that contain personal preferences and application configurations
  • D. We should track all files in the Git version control system.
Click here to see the Answer

Answer is : A
Secret we do not send to the git

show less

How can we keep an empty folder in a Git repository?

  • A. By setting a configuration in Git to track folders
  • B. By creating a blank hidden file in the target folder
  • C. By running the git status command
  • D. By adding more commits
Click here to see the Answer

Answer is : B

show less

Where does Git store the repository for each project?

  • A. In the home directory
  • B. In a remote server
  • C. In the .git folder in each working project folder
  • D. In Git’s application folder
Click here to see the Answer

Answer is : C

Show less

What does the git add command do?

  • A. It stores the changes in the repository.
  • B. It marks the changes that will be added in the next commit.
  • C. It unstages the changes
  • D. It commits partial changes in the repository.
Click here to see the Answer

Answer is : B

show less

How can we delete the entire Git history?

  • A. $ git rm -fr
  • B. $ git push -f
  • C. $ rm -fr .git
  • B. $ rm -am .git
Click here to see the Answer

Answer is : C

show less

Why don’t we always use git commit -am?

    • A. Using git add and git commit separately allows us to commit all file changes into the version control system.
    • B. The git status command is a quick, one-line operation for committing current changes.
    • C. Separating git add and git commit allows developers to carefully review the changes before committing.
    • D. The git commit -am command allows committing changes without providing a commit message.
    Click here to see the Answer

    Answer is : C

    show less

    How can we stage untracked changes in Git?

    • A. git add <filename>
    • B. $ git track <filename>
    • C. $ git commit <filename>
    • D. $ git stage <filename>
    Click here to see the Answer

    Answer is : A

    show less

    How can we view a clear branch history in the git log command to get an overview of the commit history?

    • A. $ git log –oneline –graph
    • B. $ git log –oneline
    • C. $ git log –graph
    • D. $ git log –decorate
    Click here to see the Answer

    Answer is : A

    show less

    Post navigation
    ← Previous Post

    Recent Posts

    • GIT Question
    • Ignore files in Git
    • Add Specific file using Git add
    • Git Project Initialisation
    • Git Introduction

    Categories

    • Git
    • Practise
    • Tutorial

    Copyright © 2025 knownCodes