Git Topics (9)Tap to view
    Git·Version Control·Topic 1 of 9

    Git Setup & Configuration

    Set up Git for the first time, check the version, set name and mail, and start or clone repositories.

    1. Setup and Configuration

    1. git --version

      What it doesChecks Git installation and current version number

      When to use itAfter installation or to ensure certain features are supported

      Examplegit --version

    2. git config --global user.name "Your Name"

      What it doesdisplays or sets the author name associated with all commits

      When to use itWhen setting up the development environment for the first time

      Examplegit config --global user.name "Mustafa Masoud"

    3. git config --global user.email "you@example.com"

      What it doesDisplays or sets the author email address

      When to use itto link your contributions to your GitHub account

      Examplegit config --global user.email "dev@example.com"

    4. git config --list --show-origin

      What it doesDisplays all applied settings along with the path to each setting file

      When to use itto track settings conflicts between System, Global and Local

      Examplegit config --list --show-origin


    2. Creating and Cloning Repositories

    1. git init

      What it doesStarts a new local Repository and prepares the .git folder

      When to use itWhen starting a new project from scratch locally

      Examplemkdir my-app && cd my-app && git init

    2. git clone <url>

      What it doesCopy a locally existing Repository with the full history of changes

      When to use itto download a project from GitHub or remote server

      Examplegit clone https://github.com/user/repo.git

    3. git clone --depth 1 <url>

      What it doesShallow clone to the last commit just to save time and space

      When to use itIn CI/CD pipelines or for quick loading of large projects

      Examplegit clone --depth 1 git@github.com:user/repo.git

    Offline · Reading cached copy