Skip to main content

Command Palette

Search for a command to run...

Git for Beginners: Basics and Essential Commands

Updated
•1 min read•View as Markdown
  1. What is Git?

    Ans-> Git is a distributed version control system.

    It helps developers save code changes, track history, and work safely without losing files.

    Every developers has a copy of the project on their computer.

  2. Why Git is Used?

    Ans-> Git is used to:

    a) Track code changes

    b) Work in a team

    c) Go back to older version

    d) Keep code safe

  3. Git Basics and core terminologies?

    Ans->

    a) Repository (Repo)

    -> A folder where Git track files.

    b) Commit:

    -> A saved version of your code.

    c) Branch:

    -> A separate version of code to work on new features.

    d) HEAD:

    -> Points to the current commit

  4. Common Git Commands?

    Ans-> Initialize Git = git init,

    Check file status = git status,

    Add files = git add,

    Save changes = git commit -m “message”,

    View history git log

  5. Basic Git workflow (From start)

    a) Create project folder

    b) Initialize Git

    c) Write code

    d) Add files

    e) Commit changes