Git for Beginners: Basics and Essential Commands
What is Git?
Git is a version control which can manage difference version of our projects. For easily understanding, we can say git is like a check point in a story mode game.
Purpose of Git?
Git help us track our projects by creating difference version of it. Suppose we are creating SAAS, After creating one feature we can call it version 1 while creating another feature if we face any bug at the time of testing we can simply revert to version 1 where every thing was working fine. And after fixing the bug, we can update our code base.
Git vs Git-hub :
Git is the main System which will track your project and Github is a cloud base platform which use for hosting the git system. For easy under-standing, we can say git is a youtube-video and github is youtube platform where video will get hosted or published.
Common term in Git :
- Repository
It has also known as Repo, It is a folder which we need to create for uploading our all the files.
2. Staging
Here we add our file which we want to commit in the git repository.
3. Commit
With the help of Commit, we can add description and upload files inside the repo.
4. Branching
In branching we can copy the main code files and perform testing or add function separately without altering the main code files.
5. Merge
The process of adding the branch into the main git repo is called merge.
6. Head
It refers to the current position inside git’s repository.
Get Anirbandutta’s stories in your inbox
Join Medium for free to get updates from this writer.
Basiq Git command :
- Initialize git repo
git init2. Add file in the staging area
git add . or git add "file name"3. Save your changes
git commit -m"description"4. Show current status
git status5. Show previous status
git log6. Change the branch
git branch -m"branch name"7. Connect your local repo to github
git push -u origin main8. Upload the code in github
git push9. Download the code from github
git pull10. Removing the commit
git revert or git resetGit Hub work flow diagram






