I am trying to understand Git workflows. If for example I see following random pictures taken from on the net:
They show a Remote directory and 3 Local directories namely Working dir, Staging area and Local Repo. So far what I have understood is that all the 3 local directories are the names of physically 1 directory, the one where I have cloned the remote repo for example. While I can switch this local repo into 3 different logical states, namely working dir, staging area and local repo.
Please correct me if I am wrong in this understanding.
Let me explain to you in simple words with the help of an image;
The local file system where git resides in your local machine is called as Local Repository. Let say it as a collection of everything, which resides in your computer.
Now, when you switch to one branch, you will be able to access / see files belonging to that branch. These files are present to you virtually. Which means, all files associated with other branches are hidden (not like hidden files) from you and you are presented with some files only. Lets say, the Local repository contains all files, but everything other than that particular branch are hidden from your eyes. Now, the area where you see all these files are called Workspace. So, for your understanding, lets say Local Repository + Branch = Workspace / Working directory.
Again, when you make changes to files in a branch, they are temporarily saved (staged) before permanently saving (commit) it. You may add / remove / modify files in that area before finalizing your changes. This space is called as an index.
Once you commit your changes, your files will be permanently stored in a branch, and that location where those files resides is called Local Repository.