TomoLink
CompaniesAmazonSystem DesignHow Git Works
System Design
Mediumdevtools-productivity

How Git Works

30 minsgitversion control
30 mins
1 sections
git, version control

Overview

To begin with, it's essential to identify where our code is stored. The common assumption is that there are only two locations - one on a remote server like Github and the other on our local machine. However, this isn't entirely accurate. Git maintains three local storages on our machine, which means that our code can be found in four places:

  • Working directory: where we edit files
  • Staging area: a temporary location where files are kept for the next commit
  • Local repository: contains the code that has been committed
  • Remote repository: the remote server that stores the code

Most Git commands primarily move files between these four locations.

How Git Works [Medium] | Amazon System_design | TomoLink