sign

What is Version Control?

Version control allows developers to track and manage changes to their codebase over time. Git is a distributed version control system that enables multiple developers to work on the same project simultaneously.

Git Basics

  1. git init — Initializes a new Git repository in the current directory.
  2. git clone — Clones an existing repository from GitHub to your local machine.
  3. git status — Shows the current status of your working directory.
  4. git add — Stages files for commit.
  5. git commit — Commits your staged changes.
  6. git push — Pushes your local changes to the remote repository.

Example Git Workflow

        
          git init
          git add .
          git commit -m "Initial commit"
          git push origin main
        
      

These commands will initialize your Git repository, add your changes, commit them with a message, and then push them to your GitHub repository.