Coding 101

Getting Started with Git and GitHub: A Practical Guide for Developers

DD
Ankur Ishwar
9 min read Updated Sep 7, 2026
Getting started with Git and GitHub for modern software developers

The project_final_v2_really_final.zip Nightmare

During my college days, almost every student group managed source code the exact same way: copy the project folder to a pen drive, rename it to major_project_final_v3.zip, and email it to team members before demo day. When two people edited the same file, somebody spent three agonizing hours manually copying code back and forth while praying that the server would still compile.

If you enter a tech company in Bengaluru, Hyderabad, or Pune operating like that, you will not survive your first week.

Professional engineering teams build software through distributed version control. Git and GitHub are the backbone of modern development. They track every single character change in your codebase, allow dozens of engineers to work on the exact same files simultaneously without overwriting each other, and give you an instant rollback mechanism whenever production breaks.

Git vs. GitHub: What Is the Real Difference?

Many beginners treat these two names as interchangeable synonyms. They are completely different technologies:

  • Git: A free, open-source distributed version control tool that runs entirely offline on your local computer. It was built in 2005 by Linus Torvalds (the creator of Linux). Git records file snapshots over time into a hidden .git folder.
  • GitHub: A cloud platform owned by Microsoft that hosts remote Git repositories on the web. It provides a web UI, pull request code reviews, issue trackers, CI/CD runners (GitHub Actions), and social developer profiles.

Think of Git as your local camera that takes snapshots of your code, and GitHub as Instagram where you upload and share those snapshots with the world.

Step 1: First-Time Git Setup (SSH Authentication)

First, verify that Git is installed on your operating system:

git --version
# Output: git version 2.43.0 (or similar)

Next, configure your global identity. These details attach to every single commit you create:

git config --global user.name "Ankur Ishwar"
git config --global user.email "ankur@example.com"
git config --global init.defaultBranch main

Do not use passwords or temporary personal access tokens to push code from your terminal. Set up an SSH key once, and you will never have to type credentials again:

# 1. Generate a modern ed25519 SSH key
ssh-keygen -t ed25519 -C "ankur@example.com"

# Press Enter to accept the default file path and set a passphrase

# 2. Display your public key and copy it
cat ~/.ssh/id_ed25519.pub

Go to GitHub.com > Settings > SSH and GPG keys > New SSH key. Paste your key and save it. Now verify your connection:

ssh -T git@github.com
# Output: Hi your-username! You've successfully authenticated...

Step 2: The Core Git Cycle (Working Directory to GitHub)

Git manages your code across three distinct zones on your computer before pushing to the cloud:

  1. Working Directory: The actual files you are editing in VS Code.
  2. Staging Area (Index): The staging zone where you select which modified files will belong to your next snapshot.
  3. Local Repository (.git): The permanent history of saved commits on your disk.
  4. Remote Repository (GitHub): The cloud copy synced across your team.

Here is the everyday sequence you will use hundreds of times:

# 1. Initialize Git in a fresh project folder
git init

# 2. Check the status of modified or untracked files
git status

# 3. Add modified files to the staging area
git add .

# 4. Record a permanent snapshot with a concise commit message
git commit -m "feat: create user registration endpoint"

# 5. Link your local project to a remote GitHub repository
git remote add origin git@github.com:your-username/my-awesome-app.git

# 6. Push your commits to GitHub's main branch
git push -u origin main

Step 3: Branching and Collaboration (Feature Branch Workflow)

Never write code directly on the main branch in a production team. The main branch represents code that is deployed to live users.

Whenever you start a new task, create an isolated branch:

# Create and switch to a new branch
git checkout -b feature/razorpay-integration

# Write your code, test it locally, then commit:
git add src/payments/
git commit -m "feat: add razorpay checkout webhook handler"

# Push this specific branch to GitHub:
git push -u origin feature/razorpay-integration

Once pushed, open GitHub in your browser. You will see a prompt saying "Compare & pull request". Click it, describe the changes you made, and request a review from your teammate.

Step 4: Handling Merge Conflicts Without Panic

Merge conflicts occur when two developers change the exact same line of code in different ways on separate branches. Git pauses the merge and asks a human to decide which line to keep.

When a conflict occurs, opening the file in your editor reveals conflict markers:

<<<<<<< HEAD
const apiBaseUrl = 'https://api.myapp.in/v2';
=======
const apiBaseUrl = 'https://api-prod.myapp.in/v1';
>>>>>>> feature/payment-gateway

Do not panic. You simply:

  1. Decide which line is correct (or combine both).
  2. Delete the markers (<<<<<<<, =======, >>>>>>>).
  3. Save the file.
  4. Run git add <filename> and git commit -m "fix: resolve api base url merge conflict".

Step 5: Repository Hygiene and the .gitignore File

One of the fastest ways to expose yourself as an inexperienced developer is committing garbage files to GitHub:

  • node_modules/ (hundreds of megabytes of third-party dependencies)
  • .env (API keys, database passwords, Razorpay secrets)
  • dist/ or build/ (compiled binaries)
  • .DS_Store or Thumbs.db (operating system cache files)

Always create a .gitignore file in the root of your project before making your first commit:

# Dependencies
node_modules/
vendor/

# Environment secrets (NEVER COMMIT THESE!)
.env
.env.local
*.pem

# Build outputs
dist/
build/
.next/

# OS files
.DS_Store
Thumbs.db

Practice Live Technical Interviews with AI

Sharpen your architectural thinking, data structures, and problem-solving skills against realistic technical interview scenarios with instant, automated feedback:

Launch Free AI Technical Mock Interview Simulator →

What Hiring Managers Look For on Your GitHub

Engineering leads do not care about daily dummy commits just to make your GitHub contribution graph look bright green. Everyone knows students write scripts that push empty text files every day at midnight to fake consistency.

Here is what an engineering manager actually evaluates in 60 seconds:

  1. Pinned Repositories: Pin your top 2 or 3 best projects. Make sure each repo has a live demo link in the repository header.
  2. README Quality: Does the README include a problem statement, architecture diagram, tech stack breakdown, and clear setup instructions?
  3. Commit Cleanliness: Are commits clear (feat: add jwt verification middleware) or sloppy (update, changes, fixed bug again)?
  4. Real Code: Did you build something original, or is it another tutorial clone of a Todo list?

Git and GitHub are not academic theories. They are your professional track record. Treat your repositories like your engineering resume, keep them clean, and build projects you are proud to show. To see how your public profile measures up against hiring expectations, audit your profile with our free GitHub Profile Scorer and grab an embeddable badge for your portfolio.

Found this useful?
View all articles
Free Technical Interview Prep

Practicing for Engineering Interviews?

Skip the expensive coaching bootcamps and dry LeetCode memorization. Practice real production scenarios with instant turn-by-turn AI feedback on Frontend, Backend, System Design, and DSA.

Free Utilities

Recommended Developer Tools for this Topic

Explore all 25+ tools→

Keep Reading

Related Articles

Learn with Dropout Developer

Build real software with AI

Step-by-step learning paths, vibe coding tutorials, and certified developer programs designed for the modern engineer.