Introduction
What is version control?
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
Why use Git
- Collaboration- Multiple people can work on the same project without overwriting each other's code.
- History- One can see who exactly changed what and why.
- Experimentation- One create branches to try new ideas without breaking the main project.
Tracking changes
Main areas of a Git project
- Working directory- Where you are currently editing your files.
- Staging area- Which changes you want to include in your next save point.
- Local repository- Where Git permanently stores the history of your project.
Work flow
Modify a file in your directory
Stage the file(git add)
Commit the file(git commit)
Pushing code
When you have finished making "commits" on your computer and you want to share them with the world, you Push(upload).
Pulling code
If a teammate makes changes to the code on GitHub, your local computer won't know about it automatically. You need to pull those changes down(refresh or sync).
Essentials Commands Cheat Sheet
Action Command
Initialize git init
Check Status git status
Stage Changes git add <file>
Commit git commit -m "message
Push git push origin main
Pull git pull origin main
Top comments (1)
To commit all files, use "git add ."
I usually use IntelliJ IDEA, because we do not need to write those git commands, there are direct commit and push options

Try to use this IDE for your ease