Git is a distributed version control system designed to track file changes across software projects, enable parallel team development through branching, and provide an immutable history of code updates.
flowchart TD
A["Working Directory (Unstaged Files)"] -->|"git add"| B["Staging Area / Index"]
B -->|"git commit"| C["Local Repository (.git folder)"]
C -->|"git push"| D["Remote Repository (GitHub / GitLab)"]
D -->|"git fetch / git pull"| A
Git is a free, open source tool that helps you save and manage different versions of your files and code.
With Git, you can work with others, keep track of changes, and undo mistakes.
In this tutorial, we will show you Git commands like this:
Example
git --version
git version 2.30.2.windows.1
For new users, using the terminal view can seem a bit complicated.
Don't worry! We will keep it really simple, and learning this way gives you a good grasp of how Git works.
In the code above, you can see commands (input) and output.
Lines like this are commands we input:
Example
git --version
Lines like this are the output/response to our commands:
Example
git version 2.30.2.windows.1
In general, lines with $ in front of it is input.
These are the commands you can copy and run in your terminal.
Tip for Beginners: Don't worry about making mistakes!
When you use Git on your own computer, you can't really break anything important.
Experimenting is a great way to learn, and you can always undo or redo changes as you go.
This is an optional feature. You can study at Kodersolution without creating an account.
Execute the following terminal commands to work with this concept in your workspace:
# Verify Git installation and display current version
git --version
# Check status of local working tree
git status
Fix CORS bug rather than Fixed CORS bug).git diff to review unstaged modifications before adding files to the index.git switch -c <branch-name> to preserve edits.git restore --staged <filename> to remove the file from the index without altering your local workspace copy.Open your terminal in a test project directory, execute git status, and verify your current working tree state. Practice running git log --oneline to review commit history.
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With