// LOADING
// LOADING
// LOADING_ARTICLE
If you are new to web development, you may have heard about Git and GitHub but felt confused about what they actually do. Simply put, Git helps you track changes in your code, while GitHub allows you to store and share your projects online. Together, they are among the most important tools for developers.
Git is a version control system that keeps a record of every change you make in your project. Instead of overwriting files, Git saves different versions so you can go back if something breaks.
With Git, you can
GitHub is an online platform where you can store your Git repositories. It makes collaboration easier and allows other developers to view, contribute, or review your code.
GitHub is useful for
A repository is simply a project folder that is being tracked by Git.
A commit is a saved snapshot of your project at a specific point in time.
A branch allows you to work on new features without affecting the main code.
Merging combines changes from one branch into another.
git init
This creates a new Git repository inside your project folder.
git status
This shows which files are modified, added, or ready to commit.
To add all files
git add .
To add a specific file
git add index.html
git commit -m "Initial project setup"
This saves your changes with a message describing what you did.
git log
This shows a list of all previous commits.
git branch feature-login
git checkout feature-login
Or use this modern command
git switch feature-login
First switch to main
git checkout main
Then merge
git merge feature-login
Go to GitHub, sign up, and create a profile.
Click on New Repository, give it a name, and click Create.
Copy your repository link from GitHub and run
git remote add origin https://github.com/yourusername/your-repo.git
git push -u origin main
This uploads your local project to GitHub.
After editing your files, run
git add .
git commit -m "Updated homepage design"
git push
Learning Git and GitHub helps you
Git and GitHub are essential skills for every web developer. Even as a beginner, learning these tools early will make you a better and more confident programmer. With practice, you will become comfortable managing projects, collaborating with others, and contributing to the developer community.