Git Stages (Basic Git Commands - Handle Stages)
Remote repositories such as GitLab, GitLab hub, Azure Repos, Bitbucket, they are only cloud providers. They are giving you space to store your source code. Nowadays they have started adding more features that you can manage your git directly from the portal
Git Bash
Shell that I will be employing to collaborate with Git.
Therefore, git bash an uncommonly extensive command set that enables users to manage all aspects of their workflow.
Working Directory (PWD - Parent Working Directory)
PWD has nothing to do with git if I add any files to it, and if we delete any files, git has nothing to do with it. No one is tracking any deletion or anything as such.
INIT Git Repository
Go to PWD at your local and run

This will make your working directory- with default branch ‘main’ as local
What makes this directory a local git repository is the hidden file.
We can see a local git repository directory
Inside this git repository, you can see multiple files. You can see everything related to git.
- So these are the files which is basically managing your complete local git repository. Starting with head config has all the configuration information hooks.
- It will have all the pre hooks, post hooks and different different hooks which we use.
- At later stages, When you start committing your changes adding files, you will see the history and everything as well.
if moving to another system
So along with your source code, you need to make sure that you copy this target file. Also, if you want to start from the same stage where you left your task. So you need to make sure you have your target file also copied to the other system.
Create an HTML file using CLI
Read you file in Read only Mode
STATUS CHECK of your Working Directory at local
It will help you view untracked and tracked files if you want to view and tracked files or staged files use Git Status
MOVE FILE/ADD from Working director to stating area
git add operation which will basically add the file into the staging area.
Now check status again
Git is still not tracking that file for you. Git will not bother even after from the staging area if you delete that file. Can use variation onf Git Add
- git add .
- git add /
- git add *.css
GIT COMMIT
This distributed version control basically manages its own databases in the back end. And if you want to update the information like whatever files you have added and the file which is there in the staging area, if you want that file to be part of the git local database, then you will do a git commit.
When you do a git commit, git will update those information in the local Git repository.
Once that gets added into a local git repository and later when you do any modification or deletion with that file, git will start tracking that file and git will start tracking those changes for you.
commit message: this message is very much required. Without this message, you cannot commit your changes.
One file changed, one file inserted.
Check status again