Welcome
Namaste and Welcome to to Git! Let’s learn Git the easy way with clear steps and real examples.
Namaste and Welcome to to Git! Let’s learn Git the easy way with clear steps and real examples.
Git is a free software you install on your computer (Windows, macOS, or Linux) to track changes in your files.
GitHub is like Google Drive for Git projects. You can upload your code online, share it with others, and work together as a team. GitHub is the most popular option, but there are other similar platforms too, like GitLab, Bitbucket, and SourceForge.
Git is like a smart notebook that saves every draft of your work. Imagine writing a book—Git lets you save each version so you can go back if you make a mistake. When working in a team, everyone writes their part on separate copies (branches) and later combines them into one final version (merge). In this tutorial, we’ll learn these ideas step by step in a simple way.
Version control systems are like a “time machine” for your code. They let you save different versions of your work, go back if you make a mistake, and work together with others. Think of it like checkpoints in a video game—you can always return to an earlier point if something goes wrong.
Before Git, developers used older systems like SCCS, CVS, SVN, and Perforce. But SCCS was expensive and hard to use. Git was later created to make version control free, easy, and accessible for everyone, which is why it’s so popular today.
Git installation: You can either use the command line or download it from the official website. Git works on Windows, macOS, and Linux. Download Git here
Creating an account on GitHub is another important step. GitHub offers free accounts for everyone.
To push (upload) code to GitHub: You need to set up SSH keys. This provides a secure way to log in without entering your password every time. Since GitHub no longer allows password login, SSH key setup is required.
Repository(Repo): A folder that Git is tracking. Like a project folder on your computer where all versions are saved.
Commit: A saved snapshot of your work. Like pressing “Save” in a video game or saving a draft of your essay.
Branch: An alternative timeline of your project. Like writing a “what-if” version of a story without changing the main one.
Merge: Combining changes from different branches into one. Like friends writing different chapters of a book and then putting them together.
Clone: Copying a repository from GitHub to your computer. Like downloading a Google Drive folder to your laptop.
Push: Sending your changes from your computer to GitHub. Like uploading files from your PC to Google Drive.
Pull: Getting the latest changes from GitHub to your computer. Like downloading the latest version of a shared Google Doc.
Stash:
git --version
Config Settingsgit config --global user.email "your-email@example.com"
Set your username with this command (replace it with your GitHub
username):
git config --global user.name "username"
Now you can check your config settings by running this command in
your terminal or command prompt:
git config --list
Repositorygit status
We’ll cover useful Git commands here in the next section 🚀