Git and GitHub for Beginners: A Complete Guide for Beginners — 2026
From your very first git in IT to landing an internship with a polished GitHub profile everything you need to know, explained simply.

Knowlary
Knowlary Content Team

These things have been said to you by your seniors before. Your professors always stress on these points. All the job listings require these skills. The ability to use Git and GitHub is mandatory for any software developer who wants to pursue software development in 2026 — and yet very few graduates know how to use these tools.
This article seeks to bridge that gap. This article is written for freshers who may be freshmen BCA students who have never used a command-line interface to senior BSc CSIT students who are about to go out for their internships.
What Git Actually Is?
Git is a distributed version control system that monitors modifications done to the source code, thus being predominantly used during the process of software development in order to ensure efficient handling of code by both individual programmers and teams. Git provides users with the possibility of storing commits which represent snapshots of a certain project, hence enabling them to save their work, track changes, compare versions, and even go back to previous versions when required.
Another function performed by Git includes support for branching. It allows developers to make copies of their projects for testing new functionality and resolving issues without modifying the main copy.
What Is Git? (And Why Should You Care?)
Imagine you're writing a 5,000-word assignment. You save it as assignment.docx. You edit it the next day: assignment_final.docx. Then again: assignment_final_REAL.docx. Sound familiar?
Git is the tool that helps solve this issue once and for all. Git will record every alteration made to your code and keep a complete history of everything in the development process of your project. Git also allows multiple contributors to work simultaneously on one project without overwriting their changes.
Linus Torvalds, the creator of the Linux kernel, founded Git in 2005 as he needed a version control tool that would help him manage hundreds of contributors' input to his open-source creation. Nowadays, Git is the version control tool preferred by virtually every software company out there.
Key Concept
Git is a distributed version control system. This means every developer has a complete copy of the project history on their own machine — not just the latest version. You can work offline, and nothing is lost if a server goes down.
Git vs GitHub: They Are Not the Same Thing
This is one of the most common points of confusion for beginners. Let's clear it up once and for all:
Git
- Software that is installed on your computer
- Can keep track of changes in your code locally
- Does not need any internet connection
- An open-source product that is completely free forever
- A time-travel tool for your code
GitHub
- A website or cloud-based platform owned by Microsoft
- Houses your Git repositories in the cloud
- Needs internet access
- Free for individuals, paid for companies
- Google Drive but for coding
Think of it this way: Git is the engine, GitHub is the garage. You can use Git without GitHub (storing your history only on your computer), but GitHub makes it easy to share, collaborate, and showcase your work.
Installing Git and Setting Up Your First Account
Step 1: Install Git
Git works on Windows, macOS. Here's how to get it on each:
Windows: Go to git-scm.com and download the official installer. Follow the setup process using default settings, as they are practical for new users. You will also install Git Bash, which is an application used to issue Git commands.
macOS: Open the Terminal app and type git --version. If Git isn't installed, macOS will automatically prompt you to install the Xcode Command Line Tools, which include Git.
Step 2: Configure Your Identity
Before you use Git, tell it your name and email. This information is attached to every commit (save point) you create:
git config --global user.name "Your Full Name"
git config --global user.email "you@example.com"
Step 3: Create a GitHub Account
Go to github.com and sign up for a free account. Select a username wisely because it will be seen on your portfolio, CV, and every open source code you develop. Choose a professional username such as your name or its variant.
Core Git Concepts You Must Understand
Before jumping into commands, internalize these five concepts. Everything else builds on them.
1. Repository (Repo)
A repository is a directory managed by Git. It holds your project files along with the .git directory, which contains all your version control history. When you publish your repository to GitHub, other users can clone your code and make contributions to it.
2. Commit
Commit is a saved state of your project as of a particular point in time. Imagine it as one of the checkpoints that you make during the video game. Each commit is marked with a unique identifier, time stamp, name of the author, and a commit message.
3. Branch
Branches are separate development lines. The main branch (formerly master, but now generally referred to as main) has stable and functional source code. New branches can be made to develop additional functionality or fix errors without affecting the stable code.
4. Staging Area
Staging area refers to a temporary place where files are prepared for the final commit. It allows for adding only selected changes despite modifying other files; thus, it provides a very good way of tracking down specific changes in your history.
5. Remote
Remote is an alternative version of your repository stored on some other computer, generally on GitHub. Default name for remote is origin. Commits are pushed to the remote to publish them, while commits are pulled from the remote to download them.
The Essential Git Commands (With Real Examples)
Here are the commands you'll use in almost every project. Don't try to memorize all of them at once — practice them by doing, and they'll become muscle memory within a week.
Starting a Project
# Turn an existing folder into a Git repository
git init
# Or download an existing repo from GitHub
git clone https://github.com/username/repository-name.git
Checking the Status of Your Work
# See which files are modified, staged, or untracked
git status
# See the exact lines that changed in each file
git diff
Saving Your Work (Staging and Committing)
# Stage a specific file
git add index.html
# Stage all changed files in the current directory
git add .
# Commit with a descriptive message
git commit -m "Add user registration form with validation"
Common Mistake
Write your commit message based on what you have done, why, and what it affects. "Fixed everything" doesn’t help anyone at all. "Resolved null pointer exception in login handler" works great. The best approach would be this: If you cannot write about the commit in a single sentence, then you probably need to do more work.
Working with Remotes (GitHub)
# Connect your local repo to a GitHub repository
git remote add origin https://github.com/username/repo-name.git
# Push your commits to GitHub (first time)
git push -u origin main
# Push subsequent commits
git push
# Pull latest changes from GitHub
git pull
Viewing History
# See the full commit history
git log
# Compact, one-line summary of each commit
git log --oneline
# Visualize branch history as a graph
git log --oneline --graph --all
Branching and Merging — Working Like a Pro
This is where the power of Git really lies. In any professional environment, no one ever commits anything directly into the master branch. What happens is that there will be a separate branch for every bug fix or feature.
Creating and Switching Branches
# Create a new branch and switch to it
git checkout -b feature/user-authentication
# Modern syntax (Git 2.23+)
git switch -c feature/user-authentication
# List all branches (* marks the current one)
git branch
# Switch to an existing branch
git switch main
Merging a Branch
# First, switch to the branch you want to merge INTO
git switch main
# Then merge your feature branch
git merge feature/user-authentication
# Delete the branch after merging (optional but tidy)
git branch -d feature/user-authentication
Merge Conflict Resolution
A merge conflict occurs when two branches have modified the same lines within the same file. The git does not know which modification is the right one, hence it prompts the user to choose between the two versions. This is shown in the file as:
<<<<<<< HEAD
const greeting = "Hello, World!";
======= (separator between the two versions)
const greeting = "Namaste, World!";
>>>>>>> feature/greetings
Edit the file to keep the version you want (delete the conflict markers), then stage and commit the result. Tools like VS Code show conflicts visually with Accept/Decline buttons that make this much easier.
The GitHub Workflow: Forks and Pull Requests
This is the workflow used in virtually every open-source project and most professional teams. Understanding it is essential before your first internship.
1. Fork the repository
On GitHub, click "Fork" on the project you want to contribute to. This creates your own copy of the repository under your account.
2. Clone your fork locally
Run git clone https://github.com/YOUR-USERNAME/repo.git to download your fork to your machine.
3.Create a feature branch
Never work on main directly. Create a descriptive branch: git switch -c fix/broken-navbar-link.
4.Make changes and commit
Write your code, stage your changes with git add ., and commit with a clear message.
5.Push to your fork
Run git push origin fix/broken-navbar-link to upload your branch to GitHub.
6. Open a Pull Request
On GitHub, click "Compare & pull request." Write a clear description of what you changed and why. The project maintainer reviews, comments, and eventually merges your PR.
The .gitignore File: What Not to Track
Not all the files in your project directory need to be tracked by Git. You should omit dependencies, API key environment files, compiled output, and OS-generated files. The .gitignore file instructs Git which files and directories to exclude from tracking.
Create a file named .gitignore in your project directory. For a Node.js application, you might have something like this:
# Dependencies
node_modules/
# Environment variables (NEVER commit this)
.env
.env.local
# Build output
dist/
build/
# OS files
.DS_Store # macOS
Thumbs.db # Windows
# Editor config
.vscode/settings.json
The website gitignore.io (by Toptal) can auto-generate a .gitignore for any language or framework you're using. Just type "Python", "React", "Java" etc. and it builds one for you.
Building Your GitHub Portfolio to Get Jobs in Nepal
As a tech job hunter in Nepal in 2026, a good GitHub profile might be your ticket even when applying for an internship with no prior work experience.
Now, here's the thing. This is what really matters for the recruiters/tech hiring managers:
1. Create a Good README for Every One of Your Repos
A README is a .md file created by you for your repository explaining the purpose of your project, its importance, ways to run it, and technologies used in it. Without one, a repository looks abandoned. Creating a good README proves your ability to communicate — a critical skill desired by every tech employer.
2. Pin Your Top Repositories
GitHub allows pinning up to 6 repositories on your account page. The pinned repos should be: fully complete (not half-assed), showcase your skills, and show a clear and consistent commit history. Don't pin class projects taken directly from your lectures. Instead, create something unique — even small.
3. Contribute Regularly
A green graph of your contribution in your repository is shown on your profile. It doesn't mean that you should make new commits every single day. But you can contribute regularly in other ways as well, such as documenting changes or correcting typos.
4. Contribute to Open Source
Working with open source contributions is probably one of the best messages you could ever send. This will indicate your ability to work with code you don’t understand and work with others following the contribution rules. In case you want to apply for GSoC, it would be near-imperative for you to have how to get into GSoC from Nepal and India.
5. Write Your Profile README
In GitHub, you can create a personalized repository, whose name corresponds to your username (github.com/username/username). The README file is displayed at the beginning of your profile page. This repository can be used for self-introduction, listing of your abilities, and links to your personal blog.
Useful Git Tips That Will Save You Time
1. Undo Your Last Commit (Safely)
# Undo the last commit but KEEP the changes in your files
git reset --soft HEAD~1
# Undo the last commit and DISCARD the changes (dangerous!)
git reset --hard HEAD~1
2.Stash Your Work Temporarily
# Save your changes without committing (great for switching branches)
git stash
# Bring your saved changes back
git stash pop
3.Amend Your Last Commit Message
# Fix a typo in your last commit message (before pushing)
git commit --amend -m "Corrected commit message"
4.Set Up Git Aliases for Speed
# Create shortcuts for common commands
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.lg "log --oneline --graph --all"
# Now you can use: git st, git co, git br, git lg
Recommended Tools to Use Alongside Git
Git is a command-line tool, but most developers use visual interfaces alongside it for specific tasks. Here are the tools worth knowing:
VS Code: Integrated Git support, visual diff tool, branch switcher used for daily development tasks
GitHub Desktop: GUI interface for Git management, ideal for novices , visual learning of Git
GitKraken: Professional Git GUI, visual branch history view the complicated scenarios, merge conflicts
Git Bash / Zsh: Command-line interface with Git support and expert users, scripting
How to Practice Git Effectively as a Student
Reading about Git is not enough. Here is a structured practice plan you can follow over two weeks:
Days 1–2: Set up and commit your first project
Install Git, configure your name and email, create a GitHub account, and push any existing project (or a simple HTML page) to your first repo.
Days 3–5: Learn branching with a real project
Create a small web project. Build every new feature on a separate branch. Practice merging and resolving at least one conflict intentionally.
Days 6–8: Fork and contribute to an open-source project
Find a beginner-friendly repo on GitHub (search for good-first-issue label). Fork it, fix something, and open a pull request.
Days 9–14: Polish your GitHub profile
Write README files for your 3 best projects. Create a profile README. Pin your best repos. Write descriptive commit messages for everything going forward.
An excellent free interactive resource for practicing Git commands in the browser is Learn Git Branching — it visualizes branches and merges in real time, which makes abstract concepts click much faster.
Git and GitHub Skills in Nepal's Job Market — 2026
The Nepal technology industry has developed a lot since then. Firms based in Kathmandu and Lalitpur are now developing software utilized across the globe, and working remotely for foreign clients is a norm even from cities such as Biratnagar, Pokhara, and Butwal.
The upside is that Git is an ability that you can completely showcase using your GitHub account before starting your first job. Contrary to many years of experience, you can create an impressive GitHub profile as a first- or second-year student. Check our article on portfolio building for tech students in Nepal to learn how to structure it effectively.
If you're preparing for internships specifically, our article on how to get an internship as a BSc CSIT student in Nepal walks you through everything from CV writing to technical rounds; including how interviewers assess your GitHub.
Conclusion
In today’s world, Git and GitHub have become necessary skills that one cannot ignore while entering into the software industry. If you are just starting out, it is important to learn at least a couple of commands from Git. No matter how advanced you are in your studies and what year of university you are in, Git will assist you with organizing the code, working professionally, and creating a portfolio for yourself as a developer.
It is possible to gain a lot by actively using Git and GitHub. This can help you land a job not only in Nepal but anywhere else around the globe.