loginradiusloginradius Blog

How Git Local Repository Works

In this article, I will talk about how Git Local Repository Works

How Git Local Repository Works

Let's understand how git set up a local repository Once we initialize or clone any git project that will set up a local project environment.

that whole environment will look like the below picture

git-local-environment

Project Folder: The main folder consists of a workspace and local repository

Work Directory: Inside Project Folder where we actually work,  we keep all files and perform many operations like addition, update, deletion of files

Local Repository: Here we don't actually change anything, this is handled automatically by git. this consists staging area, commit history, stash area etc.

Let's get into it step by step and see how we perform command or action and behind the scene, git do its own activity.

  • Step 1. Git clone and project: 3

    4

  • Step 2. Explore what we got in repository 5

    6

  • Step 3. Do some modification in a files 7

    8

  • Step 4. Add this file in to staging (ready for commit) 9

    10

  • Step 5. Commit the file 11

    12

  • Step 6. Push the changes 13

    14

Hope this makes clear how git handling things at the local repository.

Abhimanyu Singh Rathore

Written by Abhimanyu Singh Rathore

He is a fun-loving technocrat, artist, photographer, nature lover, leisure traveler, and developer. He actively develops full-stack apps and programs in Go and various JavaScript frameworks and libraries, especially React.

LoginRadius CIAM Platform

Our Product Experts will show you the power of the LoginRadius CIAM platform, discuss use-cases, and prove out ROI for your business.

Book A Demo Today