šŸš€ Getting Started with Git and GitHub: A Beginner’s Guide

Published: (January 18, 2026 at 12:50 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

What and Why: Git vs. GitHub

  • Go back to earlier versions if something breaks.
  • Work with teammates without overwriting each other’s work.
  • See who made what changes and when.

GitHub is a cloud‑based platform that hosts Git repositories, providing additional tools for collaboration, issue tracking, and code review. It offers remote repository hosting and integrates with Git for easier teamwork.

Your First Steps: Setting Up a Project

1. Tracking changes

git init                     # Initialize a new repository
git status                   # See untracked or modified files
git add                      # Stage selected changes
git commit -m "Message"      # Create a snapshot with a descriptive label

2. Pushing code to GitHub

  1. Create a new repository on GitHub.com.

  2. Copy the repository URL, e.g. https://github.com/your-username/my-project.git.

  3. Link your local folder to the remote (run once):

    git remote add origin https://github.com/your-username/my-project.git
  4. Push your code:

    git push -u origin main

3. Pulling code from GitHub

git pull origin main

Basic Workflow Summary

  1. Create a new repository on GitHub via the web interface.

  2. Clone it to your machine:

    git clone https://github.com/your-username/my-project.git
  3. Make changes in the working directory.

  4. Stage changes:

    git add .
  5. Commit with a message:

    git commit -m "Describe your changes"
  6. Push to GitHub:

    git push -u origin main

Happy coding, and may your code always be perfectly version‑controlled! āœØšŸ’»

Back to Blog

Related posts

Read more Ā»

A Beginner's Guide to Git and GitHub

If you have ever saved a file as final_project.py, then final_project_v2.py, and eventually final_project_v3.py, you have experienced the manual version of vers...