Student Senior BlogBlogs

Things Nobody Teaches You About Git

Sahil Verma
October 6, 2026
7 min read
Banner for Things Nobody Teaches You About Git

AI Summary

Get a quick overview of the key points

Tap Generate Magic to let AI read for you.

When you start learning Git, you usually learn the same commands:

git add, git commit, git push, git pull.

That is enough to submit a college project.

But it is not enough to work comfortably on a real software project.

The difficult part of Git isn't remembering commands. It's understanding how developers actually use Git when multiple people are changing the same codebase, something breaks, or you make a mistake.

Here are some things I wish someone had explained to me earlier.

1. Your commit history matters

A commit isn't just a way to save your code.

It is a record of what you changed and why.

Compare these:

bash
1git commit -m "changes"

and:

bash
1git commit -m "Fix JWT refresh token expiration"

The second one tells another developer exactly what happened.

Good commits make it easier to:

  • Understand old changes
  • Find when a bug was introduced
  • Review someone's work
  • Revert a specific change
  • Understand how a feature evolved

You don't need 50 commits for a small feature. You need meaningful commits.


2. Don't commit everything together

One of the easiest mistakes students make is working for three days and then doing:

bash
1git add . 2git commit -m "complete project"

Now your commit contains:

  • A new feature
  • Bug fixes
  • UI changes
  • Dependency updates
  • Maybe even debugging files

That's difficult to review and difficult to undo.

Instead, commit related changes together.

For example:

text
1feat: add user authentication 2fix: handle expired access tokens 3style: improve login page 4docs: update authentication setup

Think of each commit as a small, understandable unit of work.


3. git pull isn't magic

Many beginners think:

"Someone pushed code, so I'll just run git pull."

But git pull essentially combines two operations:

bash
1git fetch 2git merge

git fetch downloads information about changes from the remote repository.

git merge integrates those changes into your current branch.

Understanding this becomes extremely useful when something goes wrong.

You can first inspect what changed:

bash
1git fetch 2git log origin/main

Then decide how you want to integrate it.


4. Merge conflicts are normal

The first time you see:

text
1<<<<<<< HEAD 2your code 3======= 4their code 5>>>>>>> main

it can look terrifying.

It isn't.

Git is basically saying:

"Two versions of this section exist. I don't know which one you want."

You decide what the final code should look like, remove the conflict markers, and then:

bash
1git add . 2git commit

Don't treat merge conflicts as a sign that Git is broken.

They are a normal part of collaborative development.

The important skill is learning how to resolve them without accidentally deleting someone else's work.


5. Branches aren't just for big companies

You don't need a huge team to use branches.

Even when working alone, branches are useful.

Instead of directly changing main:

bash
1git checkout -b add-payment-system

Now you can work on the feature separately.

If something breaks, your main branch remains untouched.

A simple workflow can be:

text
1main 2 │ 3 ├── feature/authentication 4 ├── feature/payment 5 └── fix/login-error

When the feature is ready, merge it into main.

This is much safer than experimenting directly on your production branch.


6. You will eventually make a Git mistake

You will probably:

  • Delete something accidentally
  • Commit the wrong file
  • Push a broken change
  • Commit a .env file
  • Merge the wrong branch
  • Delete a branch
  • Rewrite something you shouldn't have

And that's okay.

Git has tools for recovering from many mistakes.

One of the most useful commands is:

bash
1git reflog

reflog keeps track of movements of your repository's HEAD.

Sometimes a commit that appears to be "gone" can still be recovered through the reflog.

This is one of those commands you may barely use as a beginner but become very grateful for later.


7. .gitignore is not optional

Your repository should not contain things like:

text
1node_modules/ 2.env 3dist/ 4*.log

For a Node.js project, your .gitignore might include:

gitignore
1node_modules 2.env 3dist 4*.log

The most important one is often:

text
1.env

Because environment files can contain:

  • API keys
  • Database credentials
  • JWT secrets
  • Private tokens

If you accidentally push a secret to GitHub, deleting the file in a later commit does not mean the secret was never exposed.

You may need to revoke and regenerate the credential.


8. Git and GitHub are not the same thing

This confused me when I started.

Git is the version control system.

GitHub is a platform that hosts Git repositories and provides collaboration features.

Other platforms exist too, such as GitLab and Bitbucket.

You can use Git without GitHub.

For example:

bash
1git init 2git add . 3git commit -m "Initial commit"

That's Git.

Pushing that repository to GitHub is a separate step.

Understanding this distinction makes Git much easier to understand.


9. Don't blindly copy Git commands from the internet

You'll eventually see commands like:

bash
1git reset --hard

or:

bash
1git push --force

Don't run them just because someone said they're useful.

Some Git commands can delete local changes or rewrite remote history.

Before running a destructive command, understand:

  • What it changes
  • Whether your changes are saved
  • Whether it affects other developers
  • Whether you can recover from it

A good developer doesn't just know more commands.

They know when not to use them.


10. Learn to read Git before trying to fix Git

When something goes wrong, beginners often immediately search:

"Git error fix"

Instead, first inspect the repository.

Useful commands include:

bash
1git status 2git log --oneline 3git branch 4git diff

For example:

bash
1git status

can immediately tell you:

  • Which branch you're on
  • Which files changed
  • Which files are staged
  • Whether you're ahead or behind the remote

Five seconds of understanding the state of your repository can save twenty minutes of random commands.


11. Your GitHub profile can become part of your portfolio

For students, Git isn't only a development tool.

Your public repositories can demonstrate how you work.

A recruiter or developer looking at your GitHub can potentially see:

  • Your projects
  • Commit history
  • Documentation
  • Code quality
  • Collaboration
  • Consistency
  • Technologies you've worked with

That doesn't mean you need to make hundreds of meaningless commits just to make your contribution graph look busy.

Build real things.

Write useful README files.

Keep important repositories clean.

Let Git document your actual work.


12. The goal isn't to memorize Git

You don't need to memorize every Git command.

Even experienced developers look up Git commands.

What you should understand is the basic mental model:

text
1Working Directory 2 ↓ 3 git add 4 ↓ 5 Staging Area 6 ↓ 7 git commit 8 ↓ 9 Local Repository 10 ↓ 11 git push 12 ↓ 13 Remote Repository

Once this makes sense, Git becomes much less mysterious.


What I Would Learn First

If you're a college student learning Git, don't try to learn everything at once.

Start with:

bash
1git init 2git clone 3git status 4git add 5git commit 6git log 7git diff 8git branch 9git switch 10git merge 11git pull 12git push 13git fetch 14git stash 15git reflog

Then practice them on a real project.

Create a repository, make a feature branch, make several commits, merge it, create a conflict, resolve it, and recover from a mistake.

That e memorxperience will teach you more thanizing 100 Git commands.

#git#github#web development#software engineering#developer tips